comparison src/fileio.c @ 9068:0a3bc9fdea20 v7.4.1819

commit https://github.com/vim/vim/commit/827b165b2aebad2cfe98cc6d5804c6c0fe8afd89 Author: Bram Moolenaar <Bram@vim.org> Date: Thu May 5 18:14:03 2016 +0200 patch 7.4.1819 Problem: Compiler warnings when sprintf() is a macro. Solution: Don't interrupt sprintf() with an #ifdef. (Michael Jarvis, closes https://github.com/vim/vim/issues/788)
author Christian Brabandt <cb@256bit.org>
date Thu, 05 May 2016 18:15:05 +0200
parents da4f6e238374
children d2b9e454c73d
comparison
equal deleted inserted replaced
9067:5b17dee417e5 9068:0a3bc9fdea20
5228 p = IObuff + STRLEN(IObuff); 5228 p = IObuff + STRLEN(IObuff);
5229 5229
5230 if (insert_space) 5230 if (insert_space)
5231 *p++ = ' '; 5231 *p++ = ' ';
5232 if (shortmess(SHM_LINES)) 5232 if (shortmess(SHM_LINES))
5233 #ifdef LONG_LONG_OFF_T
5233 sprintf((char *)p, 5234 sprintf((char *)p,
5234 #ifdef LONG_LONG_OFF_T 5235 "%ldL, %lldC", lnum, (long long)nchars);
5235 "%ldL, %lldC", lnum, (long long)nchars
5236 #else 5236 #else
5237 sprintf((char *)p,
5237 /* Explicit typecast avoids warning on Mac OS X 10.6 */ 5238 /* Explicit typecast avoids warning on Mac OS X 10.6 */
5238 "%ldL, %ldC", lnum, (long)nchars 5239 "%ldL, %ldC", lnum, (long)nchars);
5239 #endif 5240 #endif
5240 );
5241 else 5241 else
5242 { 5242 {
5243 if (lnum == 1) 5243 if (lnum == 1)
5244 STRCPY(p, _("1 line, ")); 5244 STRCPY(p, _("1 line, "));
5245 else 5245 else
5246 sprintf((char *)p, _("%ld lines, "), lnum); 5246 sprintf((char *)p, _("%ld lines, "), lnum);
5247 p += STRLEN(p); 5247 p += STRLEN(p);
5248 if (nchars == 1) 5248 if (nchars == 1)
5249 STRCPY(p, _("1 character")); 5249 STRCPY(p, _("1 character"));
5250 else 5250 else
5251 #ifdef LONG_LONG_OFF_T
5251 sprintf((char *)p, 5252 sprintf((char *)p,
5252 #ifdef LONG_LONG_OFF_T 5253 _("%lld characters"), (long long)nchars);
5253 _("%lld characters"), (long long)nchars
5254 #else 5254 #else
5255 sprintf((char *)p,
5255 /* Explicit typecast avoids warning on Mac OS X 10.6 */ 5256 /* Explicit typecast avoids warning on Mac OS X 10.6 */
5256 _("%ld characters"), (long)nchars 5257 _("%ld characters"), (long)nchars);
5257 #endif 5258 #endif
5258 );
5259 } 5259 }
5260 } 5260 }
5261 5261
5262 /* 5262 /*
5263 * Append message for missing line separator to IObuff. 5263 * Append message for missing line separator to IObuff.