Mercurial > hg > dmlib
diff tools/objlink.c @ 871:fc272f5f2d15
Make value type of dmGetIntVal() unsigned.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 03 Feb 2015 20:27:12 +0200 |
parents | b111cccf45fc |
children | 985225a93aeb |
line wrap: on
line diff
--- a/tools/objlink.c Tue Feb 03 20:07:38 2015 +0200 +++ b/tools/objlink.c Tue Feb 03 20:27:12 2015 +0200 @@ -134,7 +134,7 @@ Uint32 optInitValue = 0; int optInitValueType = 1; -int optCropStart, optCropEnd; +unsigned int optCropStart, optCropEnd; BOOL optCropOutput = FALSE; int optLoadAddress = LA_AUTO; @@ -236,10 +236,10 @@ } -BOOL dmParseSection(const char *arg, int *sectStart, int *sectEnd, char **sectName, BOOL canHasName) +BOOL dmParseSection(const char *arg, unsigned int *sectStart, unsigned int *sectEnd, char **sectName, BOOL canHasName) { char sectMode, *sep, *str, *namesep; - int tmpi; + unsigned int tmpi; // Define reserved section // Create a copy of the argument @@ -323,7 +323,7 @@ BOOL dmParseInputFile(char *arg, const int type1, const int type2, const char *desc, BOOL requireAddr) { - int tmpi = 0; + unsigned int tmpi = 0; BOOL hasAddr = FALSE; char *sep; @@ -356,7 +356,7 @@ BOOL argHandleOpt(const int optN, char *optArg, char *currArg) { char *p; - int tmpi; + unsigned int tmpi; switch (optN) { case 0: @@ -456,7 +456,7 @@ case 12: { char *sectName = "Clear"; - int sectStart, sectEnd, sectLen; + unsigned int sectStart, sectEnd, sectLen; if (!dmParseSection(optArg, §Start, §End, §Name, TRUE)) return FALSE; @@ -494,7 +494,7 @@ dmError("Invalid loading address '%s'.\n", optArg); return FALSE; } - if (tmpi < 0 || tmpi >= 64*1024) + if (tmpi >= 64*1024) { dmError("Invalid or insane loading address %d/$%x!\n", tmpi);