Changeset 3065 for trunk/src/kmk
- Timestamp:
- Sep 30, 2017, 2:52:35 PM (8 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/dir.c
r3027 r3065 715 715 const char *filename) 716 716 { 717 unsigned int hash;717 /*unsigned int hash;*/ 718 718 struct dirfile *df; 719 719 struct dirent *d; … … 749 749 #endif 750 750 751 hash = 0;751 /*hash = 0;*/ 752 752 if (filename != 0) 753 753 { -
trunk/src/kmk/expreval.c
r3038 r3065 1397 1397 1398 1398 expr_pop_and_delete_var(pThis); 1399 return kExprRet_Ok;1399 return rc; 1400 1400 } 1401 1401 -
trunk/src/kmk/job.c
r3052 r3065 2716 2716 char *p; 2717 2717 char *ap; 2718 #ifndef NDEBUG 2718 2719 char *end; 2720 #endif 2719 2721 int instring, word_has_equals, seen_nonequals, last_argument_was_empty; 2720 2722 char **new_argv = 0; … … 2850 2852 /* All the args can fit in a buffer as big as LINE is. */ 2851 2853 ap = new_argv[0] = argstr = xmalloc (i); 2854 #ifndef NDEBUG 2852 2855 end = ap + i; 2856 #endif 2853 2857 2854 2858 /* I is how many complete arguments have been found. */ … … 3160 3164 unsigned int line_len = strlen (line); 3161 3165 unsigned int sflags_len = strlen (shellflags); 3166 # ifdef WINDOWS32 3162 3167 char *command_ptr = NULL; /* used for batch_mode_shell mode */ 3168 # endif 3163 3169 char *new_line; 3164 3170 … … 3241 3247 ap += sflags_len; 3242 3248 *(ap++) = ' '; 3249 #ifdef WINDOWS32 3243 3250 command_ptr = ap; 3251 #endif 3244 3252 for (p = line; *p != '\0'; ++p) 3245 3253 { -
trunk/src/kmk/kbuild-object.c
r2720 r3065 277 277 278 278 279 #if 0 /* unused */ 279 280 /** 280 281 * Helper function for caching variable name strings. … … 293 294 return pszRet; 294 295 } 296 #endif 295 297 296 298 static struct kbuild_object * … … 559 561 assert(pObj != NULL); 560 562 if (!is_valid_kbuild_object_variable_name(pchVarNm, cchVarNm)) 561 fatal(pFileLoc, _("Invalid kBuild object variable name: '%.*s' ('% s')"),563 fatal(pFileLoc, _("Invalid kBuild object variable name: '%.*s' ('%.*s')"), 562 564 (int)cchVarNm, pchVarNm, (int)cchName, pchName); 563 565 return define_kbuild_object_variable_cached(pObj, strcache2_add(&variable_strcache, pchVarNm, cchVarNm), … … 1322 1324 lookup_kbuild_object_variable_accessor(const char *pchName, size_t cchName) 1323 1325 { 1324 const char * const pchOrgName = pchName;1325 size_t const cchOrgName = cchName;1326 /*const char * const pchOrgName = pchName;*/ 1327 /*size_t const cchOrgName = cchName;*/ 1326 1328 const char * pchVarNm; 1327 1329 size_t cchVarNm; -
trunk/src/kmk/kbuild.c
r3046 r3065 48 48 49 49 #include "kbuild.h" 50 #include "k/kDefs.h" 50 51 51 52 #include <assert.h> … … 2001 2002 struct variable *pOutBase = kbuild_get_object_base(pTarget, pSource, "outbase"); 2002 2003 struct variable *pObjSuff = kbuild_get_object_suffix(pTarget, pSource, pTool, pType, pBldTrg, pBldTrgArch, "objsuff"); 2003 struct variable *pDefs, *pIncs, *pFlags, *pDeps, *pOrderDeps, *pDirDep, *pDep, *pVar, *pOutput, *pOutputMaybe; 2004 struct variable *pDeps, *pOrderDeps, *pDirDep, *pDep, *pVar, *pOutput, *pOutputMaybe; 2005 #if 0 /** @todo figure out why this isn't used */ 2006 struct variable *pDefs, *pIncs, *pFlags; 2007 #endif 2004 2008 struct variable *pObj = kbuild_set_object_name_and_dep_and_dirdep_and_PATH_target_source(pTarget, pSource, pOutBase, pObjSuff, "obj", &pDep, &pDirDep); 2005 2009 int fInstallOldVars = 0; … … 2054 2058 2055 2059 2060 #if 0 /** @todo figure out why this isn't used */ 2056 2061 pDefs = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, NULL, 2057 2062 ST("DEFS"), ST("defs"), 1/* left-to-right */); … … 2060 2065 pFlags = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, NULL, 2061 2066 ST("FLAGS"), ST("flags"), 1/* left-to-right */); 2067 #endif 2062 2068 pDeps = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, pDefPath, 2063 2069 ST("DEPS"), ST("deps"), 1/* left-to-right */); -
trunk/src/kmk/kmkbuiltin/echo.c
r2756 r3065 73 73 { 74 74 char *errstr = strerror(errno); 75 ssize_t cchIgn = 0; /* this is to shut up irrelevant warnings on linux. */ 75 76 #ifdef _MSC_VER 76 77 int doserrno = _doserrno; 77 78 78 char szDosErr[48]; 79 sprintf(szDosErr, " (doserrno=%d)", doserrno); 79 80 #endif 80 write(STDERR_FILENO, prog, strlen(prog));81 write(STDERR_FILENO, ": ", 2);82 write(STDERR_FILENO, reason, strlen(reason));83 write(STDERR_FILENO, ": ", 2);84 write(STDERR_FILENO, errstr, strlen(errstr));81 cchIgn += write(STDERR_FILENO, prog, strlen(prog)); 82 cchIgn += write(STDERR_FILENO, ": ", 2); 83 cchIgn += write(STDERR_FILENO, reason, strlen(reason)); 84 cchIgn += write(STDERR_FILENO, ": ", 2); 85 cchIgn += write(STDERR_FILENO, errstr, strlen(errstr)); 85 86 #ifdef _MSC_VER 86 write(STDERR_FILENO, szDosErr, strlen(szDosErr));87 cchIgn += write(STDERR_FILENO, szDosErr, strlen(szDosErr)); 87 88 #endif 88 write(STDERR_FILENO, "\n", 1); 89 cchIgn += write(STDERR_FILENO, "\n", 1); 90 (void)cchIgn; 89 91 } 90 92 -
trunk/src/kmk/kmkbuiltin/err.c
r2911 r3065 55 55 char szMsg[4096]; 56 56 int cchMsg = snprintf(szMsg, sizeof(szMsg), "%s: ", g_progname); 57 if (cchMsg < sizeof(szMsg) - 1 && cchMsg > 0)57 if (cchMsg < (int)sizeof(szMsg) - 1 && cchMsg > 0) 58 58 { 59 59 int cchMsg2; … … 62 62 va_end(args); 63 63 64 if ( cchMsg < sizeof(szMsg) - 164 if ( cchMsg < (int)sizeof(szMsg) - 1 65 65 && cchMsg2 >= 0) 66 66 { 67 67 cchMsg += cchMsg2 = snprintf(&szMsg[cchMsg], sizeof(szMsg) - cchMsg, ": %s\n", strerror(error)); 68 if ( cchMsg < sizeof(szMsg) - 168 if ( cchMsg < (int)sizeof(szMsg) - 1 69 69 && cchMsg2 >= 0) 70 70 { … … 96 96 char szMsg[4096]; 97 97 int cchMsg = snprintf(szMsg, sizeof(szMsg), "%s: ", g_progname); 98 if (cchMsg < sizeof(szMsg) - 1 && cchMsg > 0)98 if (cchMsg < (int)sizeof(szMsg) - 1 && cchMsg > 0) 99 99 { 100 100 int cchMsg2; … … 103 103 va_end(args); 104 104 105 if ( cchMsg < sizeof(szMsg) - 1105 if ( cchMsg < (int)sizeof(szMsg) - 1 106 106 && cchMsg2 >= 0) 107 107 { … … 132 132 char szMsg[4096]; 133 133 int cchMsg = snprintf(szMsg, sizeof(szMsg), "%s: ", g_progname); 134 if (cchMsg < sizeof(szMsg) - 1 && cchMsg > 0)134 if (cchMsg < (int)sizeof(szMsg) - 1 && cchMsg > 0) 135 135 { 136 136 int cchMsg2; … … 139 139 va_end(args); 140 140 141 if ( cchMsg < sizeof(szMsg) - 1141 if ( cchMsg < (int)sizeof(szMsg) - 1 142 142 && cchMsg2 >= 0) 143 143 { 144 144 cchMsg += cchMsg2 = snprintf(&szMsg[cchMsg], sizeof(szMsg) - cchMsg, ": %s\n", strerror(error)); 145 if ( cchMsg < sizeof(szMsg) - 1145 if ( cchMsg < (int)sizeof(szMsg) - 1 146 146 && cchMsg2 >= 0) 147 147 { … … 169 169 char szMsg[4096]; 170 170 int cchMsg = snprintf(szMsg, sizeof(szMsg), "%s: ", g_progname); 171 if (cchMsg < sizeof(szMsg) - 1 && cchMsg > 0)171 if (cchMsg < (int)sizeof(szMsg) - 1 && cchMsg > 0) 172 172 { 173 173 int cchMsg2; … … 176 176 va_end(args); 177 177 178 if ( cchMsg < sizeof(szMsg) - 1178 if ( cchMsg < (int)sizeof(szMsg) - 1 179 179 && cchMsg2 >= 0) 180 180 { -
trunk/src/kmk/kmkbuiltin/test.c
r2736 r3065 278 278 #else /* in kmk */ 279 279 /* let job.c spawn the process, make a job.c style argv_spawn copy. */ 280 char * buf, *cur, **argv_new;280 char *cur, **argv_new; 281 281 size_t sz = 0; 282 282 int argc_new = 0; … … 288 288 289 289 argv_new = xmalloc((argc_new + 1) * sizeof(char *)); 290 buf =cur = xmalloc(sz);290 cur = xmalloc(sz); 291 291 for (i = 0; i < argc_new; i++) { 292 292 size_t len = strlen(argv_spawn[i]) + 1; -
trunk/src/kmk/misc.c
r2904 r3065 438 438 cchMsg += cchUser = vsnprintf (&szMsg[cchMsg], sizeof(szMsg) - cchMsg, fmt, args); 439 439 VA_END (args); 440 if ( cchMsg + cchStop <= sizeof(szMsg)440 if ( cchMsg + cchStop <= (int)sizeof(szMsg) 441 441 && cchUser >= 0) 442 442 {
Note:
See TracChangeset
for help on using the changeset viewer.