Take care of one BSOD in NtGdiDdCreateDirectDrawObject, it is not correct fix, it...
[reactos.git] / rosapps / mc / slang / sltoken.c
index 0f17186..64f7796 100644 (file)
@@ -62,9 +62,9 @@ char *SLexpand_escaped_char(char *p, char *ch)
    int i = 0;
    int max = 0, num, base = 0;
    char ch1;
-   
+
    ch1 = *p++;
-   
+
    switch (ch1)
      {
       default: num = ch1; break;
@@ -75,23 +75,23 @@ char *SLexpand_escaped_char(char *p, char *ch)
       case 'r': num = '\r'; break;
       case 'f': num = '\f'; break;
       case 'E': case 'e': num = 27; break;
-      case 'a': num = 7; 
+      case 'a': num = 7;
        break;
-       
+
        /* octal */
-      case '0': case '1': case '2': case '3': 
-      case '4': case '5': case '6': case '7': 
-       max = '7'; 
+      case '0': case '1': case '2': case '3':
+      case '4': case '5': case '6': case '7':
+       max = '7';
        base = 8; i = 2; num = ch1 - '0';
        break;
-       
+
       case 'd':                               /* decimal -- S-Lang extension */
-       base = 10; 
+       base = 10;
        i = 3;
        max = '9';
        num = 0;
        break;
-       
+
       case 'x':                               /* hex */
        base = 16;
        max = '9';
@@ -99,11 +99,11 @@ char *SLexpand_escaped_char(char *p, char *ch)
        num = 0;
        break;
      }
-   
+
    while (i--)
      {
        ch1 = *p;
-       
+
        if ((ch1 <= max) && (ch1 >= '0'))
          {
             num = base * num + (ch1 - '0');
@@ -117,16 +117,16 @@ char *SLexpand_escaped_char(char *p, char *ch)
        else break;
        p++;
      }
-   
+
    *ch = (char) num;
    return p;
 }
 
-void SLexpand_escaped_string (register char *s, register char *t, 
+void SLexpand_escaped_string (register char *s, register char *t,
                              register char *tmax)
 {
    char ch;
-   
+
    while (t < tmax)
      {
        ch = *t++;
@@ -146,13 +146,13 @@ int SLang_extract_token (char **linep, char *word_parm, int byte_comp)
    int string;
    char ch1;
    char *word_max;
-   
+
    word_max = word + 250;
-   
+
    line = *linep;
 
    /* skip white space */
-   while (((ch = *line) == ' ') 
+   while (((ch = *line) == ' ')
          || (ch == '\t')) line++;
 
    if ((!ch) || (ch == '\n'))
@@ -160,26 +160,26 @@ int SLang_extract_token (char **linep, char *word_parm, int byte_comp)
        *linep = line;
        return(0);
      }
-   
+
    *word++ = ch;
    line++;
-   
+
    /* Look for -something and rule out --something and -= something */
-   if ((ch == '-') && 
+   if ((ch == '-') &&
        (*line != '-') && (*line != '=') && ((*line > '9') || (*line < '0')))
      {
        *word = 0;
        *linep = line;
        return 1;
      }
-   
-       
+
+
    if (ch == '"') string = 1; else string = 0;
    if (ch == '\'')
      {
        if ((ch = *line++) != 0)
          {
-            if (ch == '\\') 
+            if (ch == '\\')
               {
                  line = SLexpand_escaped_char(line, &ch1);
                  ch = ch1;
@@ -196,8 +196,8 @@ int SLang_extract_token (char **linep, char *word_parm, int byte_comp)
      }
    else  if (!special_chars[(unsigned char) ch])
      {
-       while (ch = *line++, 
-              (ch > '"') || 
+       while (ch = *line++,
+              (ch > '"') ||
               ((ch != '\n') && (ch != 0) && (ch != '"')))
          {
             if (string)
@@ -207,7 +207,7 @@ int SLang_extract_token (char **linep, char *word_parm, int byte_comp)
                       ch = *line++;
                       if ((ch == 0) || (ch == '\n')) break;
                       if (byte_comp) *word++ = '\\';
-                      else 
+                      else
                         {
                            line = SLexpand_escaped_char(line - 1, &ch1);
                            ch = ch1;
@@ -219,7 +219,7 @@ int SLang_extract_token (char **linep, char *word_parm, int byte_comp)
                  line--;
                  break;
               }
-            
+
             *word++ = ch;
             if (word > word_max)
               {
@@ -228,7 +228,7 @@ int SLang_extract_token (char **linep, char *word_parm, int byte_comp)
               }
          }
      }
-   
+
    if ((!ch) || (ch == '\n')) line--;
    if ((ch == '"') && string) *word++ = '"'; else if (string) SLang_Error = SYNTAX_ERROR;
    *word = 0;
@@ -259,7 +259,7 @@ int SLang_guess_type (char *t)
    if (*t == '-') t++;
    p = t;
 #ifdef FLOAT_TYPE
-   if (*p != '.') 
+   if (*p != '.')
      {
 #endif
        while ((*p >= '0') && (*p <= '9')) p++;
@@ -267,7 +267,7 @@ int SLang_guess_type (char *t)
        if ((*p == 'x') && (p == t + 1))   /* 0x?? */
          {
             p++;
-            while (ch = *p, 
+            while (ch = *p,
                    ((ch >= '0') && (ch <= '9'))
                    || (((ch | 0x20) >= 'a') && ((ch | 0x20) <= 'f'))) p++;
          }
@@ -276,7 +276,7 @@ int SLang_guess_type (char *t)
        return(STRING_TYPE);
 #else
      }
-   
+
    /* now down to float case */
    if (*p == '.')
      {
@@ -297,24 +297,24 @@ int SLatoi (unsigned char *s)
    register unsigned char ch;
    register unsigned int value;
    register int base;
-   
+
    if (*s != '0') return atoi((char *) s);
 
    /* look for 'x' which indicates hex */
    s++;
-   if ((*s | 0x20) == 'x') 
+   if ((*s | 0x20) == 'x')
      {
        base = 16;
        s++;
-       if (*s == 0) 
+       if (*s == 0)
          {
             SLang_Error = SYNTAX_ERROR;
             return -1;
          }
      }
    else base = 8;
-   
-   
+
+
    value = 0;
    while ((ch = *s++) != 0)
      {
@@ -338,7 +338,7 @@ int SLatoi (unsigned char *s)
           case '7':
             ch1 -= '0';
             break;
-            
+
           case 'a':
           case 'b':
           case 'c':