git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1375
4a8a32a2-be11-0410-ad9d-
d568d2c75423
/param src Pointer to 'x' from start of hex character value
*/
/param src Pointer to 'x' from start of hex character value
*/
-char hexEscape(char **src)
-
+unsigned char hexEscape(char **src)
-char *s ;
-unsigned long value ;
-
-(*src)++ ; /* Skip over the 'x' */
-s = *src ; /* Save for error detection */
-
-value = strtol (*src, src, 16);
-
-if (s == *src)
- {
- // no valid hex found
- werror(E_INVALID_HEX);
- }
-
-else
- {
- if (value > 255)
- {
- werror(W_ESC_SEQ_OOR_FOR_CHAR);
+ char *s ;
+ unsigned long value ;
+
+ (*src)++ ; /* Skip over the 'x' */
+ s = *src ; /* Save for error detection */
+
+ value = strtol (*src, src, 16);
+
+ if (s == *src) {
+ // no valid hex found
+ werror(E_INVALID_HEX);
+ } else {
+ if (value > 255) {
+ werror(W_ESC_SEQ_OOR_FOR_CHAR);
/*------------------------------------------------------------------*/
/* octalEscape - process an octal constant of max three digits */
/* return the octal value, throw a warning for illegal octal */
/* adjust src to point at the last proccesed char */
/*------------------------------------------------------------------*/
/*------------------------------------------------------------------*/
/* octalEscape - process an octal constant of max three digits */
/* return the octal value, throw a warning for illegal octal */
/* adjust src to point at the last proccesed char */
/*------------------------------------------------------------------*/
-char octalEscape (char **str) {
+unsigned char octalEscape (char **str) {
int digits;
unsigned value=0;
int digits;
unsigned value=0;
case '5' :
case '6' :
case '7' :
case '5' :
case '6' :
case '7' :
- SPEC_CVAL (val->type).v_int = octalEscape(&s);
+ SPEC_CVAL (val->type).v_uint = octalEscape(&s);
- SPEC_CVAL (val->type).v_int = hexEscape(&s) ;
+ SPEC_CVAL (val->type).v_uint = hexEscape(&s) ;
- SPEC_CVAL (val->type).v_int = *s;
+ SPEC_CVAL (val->type).v_uint = (unsigned char)*s;
break;
}
}
else /* not a backslash */
break;
}
}
else /* not a backslash */
- SPEC_CVAL (val->type).v_int = *s;
+ SPEC_CVAL (val->type).v_int = (unsigned char)*s;