To: vim_dev@googlegroups.com Subject: Patch 9.0.0376 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0376 Problem: Clang warns for dead assignments. Solution: Adjust the code. (Yegappan Lakshmanan, closes #11048) Files: src/insexpand.c, src/ops.c, src/os_unix.c, src/userfunc.c, src/vim9instr.c, src/viminfo.c, src/xxd/xxd.c *** ../vim-9.0.0375/src/insexpand.c 2022-09-01 12:22:19.747659165 +0100 --- src/insexpand.c 2022-09-04 12:40:01.827435934 +0100 *************** *** 3121,3128 **** ? compl_curr_match->cp_number - 1 : -1); } ! // TODO ! // if (ret == OK && (what_flag & CI_WHAT_INSERTED)) } /* --- 3121,3130 ---- ? compl_curr_match->cp_number - 1 : -1); } ! if (ret == OK && (what_flag & CI_WHAT_INSERTED)) ! { ! // TODO ! } } /* *** ../vim-9.0.0375/src/ops.c 2022-09-03 10:52:18.395075356 +0100 --- src/ops.c 2022-09-04 12:40:01.827435934 +0100 *************** *** 1344,1350 **** pos.col = 0; pos.lnum++; } - ptr = ml_get_buf(curbuf, pos.lnum, FALSE); count = oap->end.col - pos.col + 1; netbeans_removed(curbuf, pos.lnum, pos.col, (long)count); // get the line again, it may have been flushed --- 1344,1349 ---- *** ../vim-9.0.0375/src/os_unix.c 2022-08-27 21:24:22.709002324 +0100 --- src/os_unix.c 2022-09-04 12:40:01.827435934 +0100 *************** *** 4522,4528 **** // restore curwin/curbuf and a few other things aucmd_restbuf(&aco); ! // only require pressing Enter when redrawing, to avoid that system() gets // the hit-enter prompt even though it didn't output anything. if (!RedrawingDisabled) wait_return(TRUE); --- 4522,4528 ---- // restore curwin/curbuf and a few other things aucmd_restbuf(&aco); ! // Only require pressing Enter when redrawing, to avoid that system() gets // the hit-enter prompt even though it didn't output anything. if (!RedrawingDisabled) wait_return(TRUE); *************** *** 5021,5027 **** { // finished all the lines, close pipe close(toshell_fd); - toshell_fd = -1; break; } lp = ml_get(lnum); --- 5021,5026 ---- *************** *** 5399,5405 **** * child already exited. */ if (wait_pid != pid) ! wait_pid = wait4pid(pid, &status); # ifdef FEAT_GUI // Close slave side of pty. Only do this after the child has --- 5398,5404 ---- * child already exited. */ if (wait_pid != pid) ! (void)wait4pid(pid, &status); # ifdef FEAT_GUI // Close slave side of pty. Only do this after the child has *************** *** 6495,6501 **** #ifdef FEAT_JOB_CHANNEL // also call when ret == 0, we may be polling a keep-open channel if (ret >= 0) ! ret = channel_select_check(ret, &rfds, &wfds); #endif #endif // HAVE_SELECT --- 6494,6500 ---- #ifdef FEAT_JOB_CHANNEL // also call when ret == 0, we may be polling a keep-open channel if (ret >= 0) ! (void)channel_select_check(ret, &rfds, &wfds); #endif #endif // HAVE_SELECT *** ../vim-9.0.0375/src/userfunc.c 2022-09-03 21:35:50.184158219 +0100 --- src/userfunc.c 2022-09-04 12:45:43.178842414 +0100 *************** *** 312,319 **** // find the end of the expression (doesn't evaluate it) any_default = TRUE; p = skipwhite(p) + 1; - whitep = p; - p = skipwhite(p); expr = p; if (eval1(&p, &rettv, NULL) != FAIL) { --- 312,317 ---- *** ../vim-9.0.0375/src/vim9instr.c 2022-09-03 21:35:50.184158219 +0100 --- src/vim9instr.c 2022-09-04 12:40:01.831435927 +0100 *************** *** 514,523 **** int generate_COND2BOOL(cctx_T *cctx) { - isn_T *isn; - RETURN_OK_IF_SKIP(cctx); ! if ((isn = generate_instr(cctx, ISN_COND2BOOL)) == NULL) return FAIL; // type becomes bool --- 514,521 ---- int generate_COND2BOOL(cctx_T *cctx) { RETURN_OK_IF_SKIP(cctx); ! if (generate_instr(cctx, ISN_COND2BOOL) == NULL) return FAIL; // type becomes bool *************** *** 741,753 **** int generate_PUSHCHANNEL(cctx_T *cctx) { - #ifdef FEAT_JOB_CHANNEL - isn_T *isn; - #endif - RETURN_OK_IF_SKIP(cctx); #ifdef FEAT_JOB_CHANNEL ! if ((isn = generate_instr_type(cctx, ISN_PUSHCHANNEL, &t_channel)) == NULL) return FAIL; return OK; #else --- 739,747 ---- int generate_PUSHCHANNEL(cctx_T *cctx) { RETURN_OK_IF_SKIP(cctx); #ifdef FEAT_JOB_CHANNEL ! if (generate_instr_type(cctx, ISN_PUSHCHANNEL, &t_channel) == NULL) return FAIL; return OK; #else *************** *** 762,774 **** int generate_PUSHJOB(cctx_T *cctx) { - #ifdef FEAT_JOB_CHANNEL - isn_T *isn; - #endif - RETURN_OK_IF_SKIP(cctx); #ifdef FEAT_JOB_CHANNEL ! if ((isn = generate_instr_type(cctx, ISN_PUSHJOB, &t_job)) == NULL) return FAIL; return OK; #else --- 756,764 ---- int generate_PUSHJOB(cctx_T *cctx) { RETURN_OK_IF_SKIP(cctx); #ifdef FEAT_JOB_CHANNEL ! if (generate_instr_type(cctx, ISN_PUSHJOB, &t_job) == NULL) return FAIL; return OK; #else *************** *** 1067,1076 **** int generate_LOCKCONST(cctx_T *cctx) { - isn_T *isn; - RETURN_OK_IF_SKIP(cctx); ! if ((isn = generate_instr(cctx, ISN_LOCKCONST)) == NULL) return FAIL; return OK; } --- 1057,1064 ---- int generate_LOCKCONST(cctx_T *cctx) { RETURN_OK_IF_SKIP(cctx); ! if (generate_instr(cctx, ISN_LOCKCONST) == NULL) return FAIL; return OK; } *** ../vim-9.0.0375/src/viminfo.c 2022-08-29 15:06:46.720715534 +0100 --- src/viminfo.c 2022-09-04 12:40:01.831435927 +0100 *************** *** 2324,2330 **** // Read the next line. If it has the "*" mark compare the // time stamps. Write entries from "buflist" that are // newer. ! if (!(eof = viminfo_readline(virp)) && line[0] == TAB) { did_read_line = TRUE; if (line[1] == '*') --- 2324,2330 ---- // Read the next line. If it has the "*" mark compare the // time stamps. Write entries from "buflist" that are // newer. ! if (!viminfo_readline(virp) && line[0] == TAB) { did_read_line = TRUE; if (line[1] == '*') *** ../vim-9.0.0375/src/xxd/xxd.c 2022-06-29 20:24:46.110172347 +0100 --- src/xxd/xxd.c 2022-09-04 12:40:01.831435927 +0100 *************** *** 782,788 **** } p = 0; - c = 0; while ((length < 0 || p < length) && (c = getc_or_die(fp)) != EOF) { FPRINTF_OR_DIE((fpo, (hexx == hexxa) ? "%s0x%02x" : "%s0X%02X", --- 782,787 ---- *** ../vim-9.0.0375/src/version.c 2022-09-04 12:29:22.148893105 +0100 --- src/version.c 2022-09-04 12:41:15.487301508 +0100 *************** *** 705,706 **** --- 705,708 ---- { /* Add new patch number below this line */ + /**/ + 376, /**/ -- Normal people believe that if it ain't broke, don't fix it. Engineers believe that if it ain't broke, it doesn't have enough features yet. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///