To: vim_dev@googlegroups.com Subject: Patch 7.4.1061 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1061 Problem: Compiler warning for ignoring return value of fwrite(). Solution: Do use the return value. (idea: Charles Campbell) Files: src/misc2.c, src/proto/misc2.pro *** ../vim-7.4.1060/src/misc2.c 2016-01-07 21:24:57.337499493 +0100 --- src/misc2.c 2016-01-07 22:22:48.855722867 +0100 *************** *** 6300,6307 **** /* * Write time_t to file "fd" in 8 bytes. */ ! void put_time(fd, the_time) FILE *fd; time_t the_time; --- 6300,6308 ---- /* * Write time_t to file "fd" in 8 bytes. + * Returns FAIL when the write failed. */ ! int put_time(fd, the_time) FILE *fd; time_t the_time; *************** *** 6309,6315 **** char_u buf[8]; time_to_bytes(the_time, buf); ! (void)fwrite(buf, (size_t)8, (size_t)1, fd); } /* --- 6310,6316 ---- char_u buf[8]; time_to_bytes(the_time, buf); ! return fwrite(buf, (size_t)8, (size_t)1, fd) == 1 ? OK : FAIL; } /* *** ../vim-7.4.1060/src/proto/misc2.pro 2016-01-07 21:24:57.337499493 +0100 --- src/proto/misc2.pro 2016-01-07 22:23:44.279120092 +0100 *************** *** 105,111 **** time_t get8ctime __ARGS((FILE *fd)); char_u *read_string __ARGS((FILE *fd, int cnt)); int put_bytes __ARGS((FILE *fd, long_u nr, int len)); ! void put_time __ARGS((FILE *fd, time_t the_time)); void time_to_bytes __ARGS((time_t the_time, char_u *buf)); int has_non_ascii __ARGS((char_u *s)); void parse_queued_messages __ARGS((void)); --- 105,111 ---- time_t get8ctime __ARGS((FILE *fd)); char_u *read_string __ARGS((FILE *fd, int cnt)); int put_bytes __ARGS((FILE *fd, long_u nr, int len)); ! int put_time __ARGS((FILE *fd, time_t the_time)); void time_to_bytes __ARGS((time_t the_time, char_u *buf)); int has_non_ascii __ARGS((char_u *s)); void parse_queued_messages __ARGS((void)); *** ../vim-7.4.1060/src/version.c 2016-01-07 22:00:57.805984639 +0100 --- src/version.c 2016-01-07 22:21:36.632508365 +0100 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 1061, /**/ -- A special cleaning ordinance bans housewives from hiding dirt and dust under a rug in a dwelling. [real standing law in Pennsylvania, United States of America] /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///