comparison src/gui_at_fs.c @ 16764:ef00b6bc186b v8.1.1384

patch 8.1.1384: using "int" for alloc() often results in compiler warnings commit https://github.com/vim/vim/commit/964b3746b9c81e65887e2ac9a335f181db2bb592 Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 24 18:54:09 2019 +0200 patch 8.1.1384: using "int" for alloc() often results in compiler warnings Problem: Using "int" for alloc() often results in compiler warnings. Solution: Use "size_t" and remove type casts. Remove alloc_check(), Vim only works with 32 bit ints anyway.
author Bram Moolenaar <Bram@vim.org>
date Fri, 24 May 2019 19:00:07 +0200
parents 55ccc2d353bd
children 79e10adc821d
comparison
equal deleted inserted replaced
16763:fccf84413b53 16764:ef00b6bc186b
497 (unsigned)(Alloc * sizeof(SFEntry))); 497 (unsigned)(Alloc * sizeof(SFEntry)));
498 SFlogins = (SFLogin *) XtRealloc((char *)SFlogins, 498 SFlogins = (SFLogin *) XtRealloc((char *)SFlogins,
499 (unsigned)(Alloc * sizeof(SFLogin))); 499 (unsigned)(Alloc * sizeof(SFLogin)));
500 } 500 }
501 len = strlen(pw->pw_name); 501 len = strlen(pw->pw_name);
502 entries[i].real = XtMalloc((unsigned) (len + 3)); 502 entries[i].real = XtMalloc((unsigned)(len + 3));
503 (void) strcat(strcpy(entries[i].real, "~"), pw->pw_name); 503 (void) strcat(strcpy(entries[i].real, "~"), pw->pw_name);
504 entries[i].shown = entries[i].real; 504 entries[i].shown = entries[i].real;
505 entries[i].statDone = 1; 505 entries[i].statDone = 1;
506 if (len > maxChars) 506 if (len > maxChars)
507 maxChars = len; 507 maxChars = len;
1305 if (shown) 1305 if (shown)
1306 { 1306 {
1307 int len; 1307 int len;
1308 1308
1309 len = strlen(shown); 1309 len = strlen(shown);
1310 entry->shown = XtMalloc((unsigned) (len + 2)); 1310 entry->shown = XtMalloc((unsigned)(len + 2));
1311 (void) strcpy(entry->shown, shown); 1311 (void) strcpy(entry->shown, shown);
1312 SFwriteStatChar(entry->shown, len, &statBuf); 1312 SFwriteStatChar(entry->shown, len, &statBuf);
1313 entry->shown[len + 1] = 0; 1313 entry->shown[len + 1] = 0;
1314 } 1314 }
1315 } 1315 }
2030 (unsigned) (Alloc * sizeof(SFEntry))); 2030 (unsigned) (Alloc * sizeof(SFEntry)));
2031 } 2031 }
2032 result[i].statDone = 0; 2032 result[i].statDone = 0;
2033 str = dp->d_name; 2033 str = dp->d_name;
2034 len = strlen(str); 2034 len = strlen(str);
2035 result[i].real = XtMalloc((unsigned) (len + 2)); 2035 result[i].real = XtMalloc((unsigned)(len + 2));
2036 (void) strcat(strcpy(result[i].real, str), " "); 2036 (void) strcat(strcpy(result[i].real, str), " ");
2037 if (len > maxChars) 2037 if (len > maxChars)
2038 maxChars = len; 2038 maxChars = len;
2039 result[i].shown = result[i].real; 2039 result[i].shown = result[i].real;
2040 i++; 2040 i++;