[Pcre-svn] [1032] code/trunk: Get rid of compiler warnings f…

Página superior
Eliminar este mensaje
Autor: Subversion repository
Fecha:  
A: pcre-svn
Asunto: [Pcre-svn] [1032] code/trunk: Get rid of compiler warnings for unused variables and a missing initializer
Revision: 1032
          http://vcs.pcre.org/viewvc?view=rev&revision=1032
Author:   ph10
Date:     2012-09-08 17:05:38 +0100 (Sat, 08 Sep 2012)


Log Message:
-----------
Get rid of compiler warnings for unused variables and a missing initializer
when UTF support is not configured.

Modified Paths:
--------------
    code/trunk/pcre_study.c
    code/trunk/pcre_ucd.c
    code/trunk/pcre_valid_utf8.c


Modified: code/trunk/pcre_study.c
===================================================================
--- code/trunk/pcre_study.c    2012-09-08 15:59:01 UTC (rev 1031)
+++ code/trunk/pcre_study.c    2012-09-08 16:05:38 UTC (rev 1032)
@@ -564,9 +564,11 @@
     (void)PRIV(ord2utf)(c, buff);
     SET_BIT(buff[0]);
     }
-#endif
+#endif  /* Not SUPPORT_UCP */
   return p;
   }
+#else  /* Not SUPPORT_UTF */
+(void)(utf);   /* Stops warning for unused parameter */ 
 #endif


/* Not UTF-8 mode, or character is less than 127. */

Modified: code/trunk/pcre_ucd.c
===================================================================
--- code/trunk/pcre_ucd.c    2012-09-08 15:59:01 UTC (rev 1031)
+++ code/trunk/pcre_ucd.c    2012-09-08 16:05:38 UTC (rev 1032)
@@ -18,7 +18,7 @@
 Instead, just supply small dummy tables. */


#ifndef SUPPORT_UCP
-const ucd_record PRIV(ucd_records)[] = {{0,0,0 }};
+const ucd_record PRIV(ucd_records)[] = {{0,0,0,0 }};
const pcre_uint8 PRIV(ucd_stage1)[] = {0};
const pcre_uint16 PRIV(ucd_stage2)[] = {0};
#else

Modified: code/trunk/pcre_valid_utf8.c
===================================================================
--- code/trunk/pcre_valid_utf8.c    2012-09-08 15:59:01 UTC (rev 1031)
+++ code/trunk/pcre_valid_utf8.c    2012-09-08 16:05:38 UTC (rev 1032)
@@ -288,9 +288,10 @@
     }
   }


-#else /* SUPPORT_UTF */
+#else /* Not SUPPORT_UTF */
(void)(string); /* Keep picky compilers happy */
(void)(length);
+(void)(erroroffset);
#endif

return PCRE_UTF8_ERR0; /* This indicates success */