From d0fec270e1228102e28fe5732ccfdb2435d913f8 Mon Sep 17 00:00:00 2001 From: borutr Date: Sun, 21 Jan 2007 14:42:52 +0000 Subject: [PATCH] * src/SDCCval.c: fixed bug introduced by me in rev. #4577 * support/cpp2/libcpp/lex.c: fixed gcc 4.1.1 warnings git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4591 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- as/mcs51/asx8051.dsp | 14 +++++++------- src/SDCCval.c | 2 ++ support/cpp2/libcpp/lex.c | 34 +++++++++++++++++----------------- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/as/mcs51/asx8051.dsp b/as/mcs51/asx8051.dsp index ae242dbb..4b6a1cfe 100644 --- a/as/mcs51/asx8051.dsp +++ b/as/mcs51/asx8051.dsp @@ -7,19 +7,19 @@ CFG=asx8051 - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "asx8051.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "asx8051.mak" CFG="asx8051 - Win32 Release" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "asx8051 - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "asx8051 - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -77,7 +77,7 @@ LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:console /machine:I386 /out:"..\..\bin_vc\asx8051.exe" /pdbtype:sept # ADD LINK32 /nologo /subsystem:console /machine:I386 /out:"..\..\bin_vc\asx8051.exe" /pdbtype:sept -!ENDIF +!ENDIF # Begin Target diff --git a/src/SDCCval.c b/src/SDCCval.c index 0dd0d22d..575d0e92 100644 --- a/src/SDCCval.c +++ b/src/SDCCval.c @@ -827,6 +827,8 @@ unsigned char hexEscape(const char **src) werror(W_ESC_SEQ_OOR_FOR_CHAR); } } + *src = s; + return (char) value; } diff --git a/support/cpp2/libcpp/lex.c b/support/cpp2/libcpp/lex.c index 791bdfe9..be96d97b 100644 --- a/support/cpp2/libcpp/lex.c +++ b/support/cpp2/libcpp/lex.c @@ -327,27 +327,27 @@ skip_asm_block (cpp_reader *pfile) c = *buffer->cur++; if (prev_space && c == '_') - { + { if (buffer->cur + _ENDASM_LEN <= buffer->rlimit && - strncmp(buffer->cur, _ENDASM_STR, _ENDASM_LEN) == 0) + strncmp((char *)buffer->cur, _ENDASM_STR, _ENDASM_LEN) == 0) { buffer->cur += _ENDASM_LEN; ret = 0; - break; + break; } - } + } else if (c == '\n') - { - unsigned int cols; - --buffer->cur; - _cpp_process_line_notes (pfile, true); - if (buffer->next_line >= buffer->rlimit) - return true; - _cpp_clean_line (pfile); - - cols = buffer->next_line - buffer->line_base; - CPP_INCREMENT_LINE (pfile, cols); - } + { + unsigned int cols; + --buffer->cur; + _cpp_process_line_notes (pfile, true); + if (buffer->next_line >= buffer->rlimit) + return true; + _cpp_clean_line (pfile); + + cols = buffer->next_line - buffer->line_base; + CPP_INCREMENT_LINE (pfile, cols); + } } _cpp_process_line_notes (pfile, true); @@ -949,10 +949,10 @@ lex_string (cpp_reader *pfile, cpp_token *token, const uchar *base) CRs are automatically generated, because the output is opened in TEXT mode. If dest == NULL, only count chars */ static unsigned int -copy_text_chars (char *dest, const char *src, unsigned int len) +copy_text_chars (unsigned char *dest, const unsigned char *src, unsigned int len) { unsigned int n = 0; - const char *p; + const unsigned char *p; for (p = src; p != src + len; ++p) { -- 2.30.2