util  Diff

Differences From Artifact [8f8960ef17]:

To Artifact [1bfb924710]:


    17     17   
    18     18   #include <stdio.h>
    19     19   #include <stdlib.h>
    20     20   #include <string.h>
    21     21   #include <unistd.h>
    22     22   #include <fcntl.h>
    23     23   #include <sys/mman.h>
           24  +#include <assert.h>
    24     25   
    25     26   enum       e { ok, badname, nofile };
    26     27   enum    kind { css, sass, scss, bad };
    27     28   typedef enum { false, true } bool;
    28     29   
    29     30   #define corebufsz 1024
    30     31   char corebuf[corebufsz];
................................................................................
    47     48   				size_t rsz = bufptr-extbuf;
    48     49   				extbuf = realloc(extbuf, run);
    49     50   				bufptr = extbuf + rsz + sz;
    50     51   				return bufptr - sz;
    51     52   			}
    52     53   		}
    53     54   	}
    54         -	// this point should never be reached
           55  +	assert(false); /* this point should never be reached */
    55     56   	mkptr: {
    56     57   		void* ret = bufptr;
    57     58   		bufptr += sz;
    58     59   		return ret;
    59     60   	}
    60     61   }
    61     62   
................................................................................
   123    124   		*namecur = 0;
   124    125   		printf("found import to %s;\n", namebuf);
   125    126   		namecur = namebuf;
   126    127   	}
   127    128   	++cur; goto read_start;
   128    129   
   129    130   read_string:
   130         -	if (*cur == 0) goto read_done; //unterminated string!?
          131  +	if (*cur == 0) goto read_done; /* unterminated string!? */
   131    132   	if (*cur++ == strqt) goto read_start;
   132    133   	goto read_string;
   133    134   
   134    135   read_ml_comment:
   135         -	if (*cur == 0) goto read_done; //unterminated comment!
          136  +	if (*cur == 0) goto read_done; /* unterminated comment! */
   136    137   	if (*cur == '*' && cur[1] == '/') {
   137    138   		cur += 2;
   138    139   		goto read_start;
   139    140   	}
   140    141   	++cur; goto read_ml_comment;
   141    142   
   142    143   skip_line: