~ubuntu-branches/ubuntu/natty/lighttpd/natty

« back to all changes in this revision

Viewing changes to src/lemon.c

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Krzyżaniak (eloy)
  • Date: 2009-10-30 17:37:29 UTC
  • mto: (6.1.4 squeeze)
  • mto: This revision was merged to the branch mainline in revision 50.
  • Revision ID: james.westby@ubuntu.com-20091030173729-ehmsdiba9nkcd0j7
Tags: upstream-1.4.24
Import upstream version 1.4.24

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#   endif
40
40
#endif
41
41
 
 
42
#if __GNUC__ > 2
 
43
#define NORETURN __attribute__ ((__noreturn__))
 
44
#else
 
45
#define NORETURN
 
46
#endif
 
47
 
42
48
/* #define PRIVATE static */
43
49
#define PRIVATE static
44
50
 
51
57
char *msort();
52
58
extern void *malloc();
53
59
 
54
 
extern void memory_error();
 
60
extern void memory_error() NORETURN;
55
61
 
56
62
/******** From the file "action.h" *************************************/
57
63
struct action *Action_new();
59
65
void Action_add();
60
66
 
61
67
/********* From the file "assert.h" ************************************/
62
 
void myassert();
 
68
void myassert() NORETURN;
63
69
#ifndef NDEBUG
64
70
#  define assert(X) if(!(X))myassert(__FILE__,__LINE__)
65
71
#else
1333
1339
/* Report an out-of-memory condition and abort.  This function
1334
1340
** is used mostly by the "MemoryCheck" macro in struct.h
1335
1341
*/
1336
 
void memory_error(){
 
1342
void memory_error() {
1337
1343
  fprintf(stderr,"Out of memory.  Aborting...\n");
1338
1344
  exit(1);
1339
1345
}
1608
1614
FILE *err;
1609
1615
{
1610
1616
  int spcnt, i;
1611
 
  spcnt = 0;
1612
1617
  if( argv[0] ) fprintf(err,"%s",argv[0]);
1613
1618
  spcnt = strlen(argv[0]) + 1;
1614
1619
  for(i=1; i<n && argv[i]; i++){
2336
2341
  if( filebuf==0 ){
2337
2342
    ErrorMsg(ps.filename,0,"Can't allocate %d of memory to hold this file.",
2338
2343
      filesize+1);
 
2344
    fclose(fp);
2339
2345
    gp->errorcnt++;
2340
2346
    return;
2341
2347
  }
2343
2349
    ErrorMsg(ps.filename,0,"Can't read in all %d bytes of this file.",
2344
2350
      filesize);
2345
2351
    free(filebuf);
 
2352
    fclose(fp);
2346
2353
    gp->errorcnt++;
2347
2354
    return;
2348
2355
  }
2913
2920
 }else if( sp->destructor ){
2914
2921
   cp = sp->destructor;
2915
2922
   fprintf(out,"#line %d \"%s\"\n{",sp->destructorln,lemp->filename);
2916
 
 }else if( lemp->vardest ){
 
2923
 }else{
2917
2924
   cp = lemp->vardest;
2918
2925
   if( cp==0 ) return;
2919
2926
   fprintf(out,"#line %d \"%s\"\n{",lemp->vardestln,lemp->filename);
3042
3049
int *plineno;               /* Pointer to the line number */
3043
3050
int mhflag;                 /* True if generating makeheaders output */
3044
3051
{
3045
 
  int lineno = *plineno;    /* The line number of the output */
 
3052
  int lineno;               /* The line number of the output */
3046
3053
  char **types;             /* A hash table of datatypes */
3047
3054
  int arraysize;            /* Size of the "types" array */
3048
3055
  int maxdtlength;          /* Maximum length of any ".datatype" field. */