embryo_cc_sc2.c | embryo_cc_sc2.c | |||
---|---|---|---|---|
skipping to change at line 21 | skipping to change at line 21 | |||
* freely, subject to the following restrictions: | * freely, subject to the following restrictions: | |||
* | * | |||
* 1. The origin of this software must not be misrepresented; you must no t | * 1. The origin of this software must not be misrepresented; you must no t | |||
* claim that you wrote the original software. If you use this softwar e in | * claim that you wrote the original software. If you use this softwar e in | |||
* a product, an acknowledgment in the product documentation would be | * a product, an acknowledgment in the product documentation would be | |||
* appreciated but is not required. | * appreciated but is not required. | |||
* 2. Altered source versions must be plainly marked as such, and must no t be | * 2. Altered source versions must be plainly marked as such, and must no t be | |||
* misrepresented as being the original software. | * misrepresented as being the original software. | |||
* 3. This notice may not be removed or altered from any source distribut ion. | * 3. This notice may not be removed or altered from any source distribut ion. | |||
* | * | |||
* Version: $Id: embryo_cc_sc2.c 62382 2011-08-12 12:39:29Z billiob $ | * Version: $Id: embryo_cc_sc2.c 72865 2012-06-26 09:08:54Z stefan $ | |||
*/ | */ | |||
#ifdef HAVE_CONFIG_H | #ifdef HAVE_CONFIG_H | |||
# include <config.h> | # include <config.h> | |||
#endif | #endif | |||
#include <assert.h> | #include <assert.h> | |||
#include <stdio.h> | #include <stdio.h> | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#include <string.h> | #include <string.h> | |||
skipping to change at line 723 | skipping to change at line 723 | |||
{ | { | |||
str = strchr(str, '\0'); | str = strchr(str, '\0'); | |||
*str++ = chr; | *str++ = chr; | |||
*str = '\0'; | *str = '\0'; | |||
} | } | |||
static int | static int | |||
preproc_expr(cell * val, int *tag) | preproc_expr(cell * val, int *tag) | |||
{ | { | |||
int result; | int result; | |||
int index; | int idx; | |||
cell code_index; | cell code_index; | |||
char *term; | char *term; | |||
/* Disable staging; it should be disabled already because | /* Disable staging; it should be disabled already because | |||
* expressions may not be cut off half-way between conditional | * expressions may not be cut off half-way between conditional | |||
* compilations. Reset the staging index, but keep the code | * compilations. Reset the staging index, but keep the code | |||
* index. | * index. | |||
*/ | */ | |||
if (stgget(&index, &code_index)) | if (stgget(&idx, &code_index)) | |||
{ | { | |||
error(57); /* unfinished expression */ | error(57); /* unfinished expression */ | |||
stgdel(0, code_index); | stgdel(0, code_index); | |||
stgset(FALSE); | stgset(FALSE); | |||
} /* if */ | } /* if */ | |||
/* append a special symbol to the string, so the expression | /* append a special symbol to the string, so the expression | |||
* analyzer won't try to read a next line when it encounters | * analyzer won't try to read a next line when it encounters | |||
* an end-of-line | * an end-of-line | |||
*/ | */ | |||
assert(strlen(pline) < sLINEMAX); | assert(strlen(pline) < sLINEMAX); | |||
skipping to change at line 821 | skipping to change at line 821 | |||
* | * | |||
* Global variables: iflevel, skiplevel, elsedone (altered) | * Global variables: iflevel, skiplevel, elsedone (altered) | |||
* lptr (altered) | * lptr (altered) | |||
*/ | */ | |||
static int | static int | |||
command(void) | command(void) | |||
{ | { | |||
int tok, ret; | int tok, ret; | |||
cell val; | cell val; | |||
char *str; | char *str; | |||
int index; | int idx; | |||
cell code_index; | cell code_index; | |||
while (*lptr <= ' ' && *lptr != '\0') | while (*lptr <= ' ' && *lptr != '\0') | |||
lptr += 1; | lptr += 1; | |||
if (*lptr == '\0') | if (*lptr == '\0') | |||
return CMD_EMPTYLINE; /* empty line */ | return CMD_EMPTYLINE; /* empty line */ | |||
if (*lptr != '#') | if (*lptr != '#') | |||
return skiplevel > 0 ? CMD_CONDFALSE : CMD_NONE; /* it is not a compi ler directive */ | return skiplevel > 0 ? CMD_CONDFALSE : CMD_NONE; /* it is not a compi ler directive */ | |||
/* compiler directive found */ | /* compiler directive found */ | |||
indent_nowarn = TRUE; /* allow loose indentation" */ | indent_nowarn = TRUE; /* allow loose indentation" */ | |||
lexclr(FALSE); /* clear any "pushed" tokens */ | lexclr(FALSE); /* clear any "pushed" tokens */ | |||
/* on a pending expression, force to return a silent ';' token and force to | /* on a pending expression, force to return a silent ';' token and force to | |||
* re-read the line | * re-read the line | |||
*/ | */ | |||
if (!sc_needsemicolon && stgget(&index, &code_index)) | if (!sc_needsemicolon && stgget(&idx, &code_index)) | |||
{ | { | |||
lptr = term_expr; | lptr = term_expr; | |||
return CMD_TERM; | return CMD_TERM; | |||
} /* if */ | } /* if */ | |||
tok = lex(&val, &str); | tok = lex(&val, &str); | |||
ret = skiplevel > 0 ? CMD_CONDFALSE : CMD_DIRECTIVE; /* preset 'r et' to CMD_DIRECTIVE (most common case) */ | ret = skiplevel > 0 ? CMD_CONDFALSE : CMD_DIRECTIVE; /* preset 'r et' to CMD_DIRECTIVE (most common case) */ | |||
switch (tok) | switch (tok) | |||
{ | { | |||
case tpIF: /* conditional compilation */ | case tpIF: /* conditional compilation */ | |||
ret = CMD_IF; | ret = CMD_IF; | |||
End of changes. 5 change blocks. | ||||
5 lines changed or deleted | 5 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |