lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r467768 - in /lucene/lucy/trunk/charmonizer/src: ./ Charmonizer/Core/ Charmonizer/Modules/ Charmonizer/Test/
Date Wed, 25 Oct 2006 21:11:36 GMT
Author: marvin
Date: Wed Oct 25 14:11:34 2006
New Revision: 467768

URL: http://svn.apache.org/viewvc?view=rev&rev=467768
Log:
Respond  to several compiler warnings.  Remove unused vars. Break up constant
strings greater than 509 characters. Add missing #include directives.
Const-ify some function signatures.  Fix some declaration-after-statement
problems.

Modified:
    lucene/lucy/trunk/charmonizer/src/Charmonizer.charm
    lucene/lucy/trunk/charmonizer/src/Charmonizer.harm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.charm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.harm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.charm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/Integers.charm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/LargeFiles.harm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/FuncMacro.charm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/Integers.charm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/UnusedVars.charm
    lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/VariadicMacros.charm

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer.charm?view=diff&rev=467768&r1=467767&r2=467768
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer.charm Wed Oct 25 14:11:34 2006
@@ -73,6 +73,7 @@
     return slurp_file(filepath, len_ptr);
 }
 
+void
 chaz_write_charm_test_h()
 {
     ModHand_write_charm_test_h();

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer.harm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer.harm?view=diff&rev=467768&r1=467767&r2=467768
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer.harm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer.harm Wed Oct 25 14:11:34 2006
@@ -39,6 +39,7 @@
  * _charm_test.h in the current working directory.  This file is needed for
  * testing Charmonizer's output using the files in Charmonizer/Test.
  */
+void
 chaz_write_charm_test_h();
 
 #endif /* include guard */

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.charm?view=diff&rev=467768&r1=467767&r2=467768
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.charm Wed Oct 25 14:11:34
2006
@@ -24,10 +24,8 @@
 test_compile(Compiler *self);
 
 chaz_Compiler*
-chaz_CC_new(OperSys *oper_sys, char *cc_command, char *cc_flags)
+chaz_CC_new(OperSys *oper_sys, const char *cc_command, const char *cc_flags)
 {
-    int i;
-    char *compiler_nick;
     CompilerSpec *compiler_spec = CCSpec_find_spec();
     Compiler *self = (Compiler*)malloc(sizeof(Compiler));
 
@@ -72,7 +70,6 @@
 compile_exe(Compiler *self, const char *source_path, const char *exe_path, 
             const char *code, size_t code_len)
 {
-    FILE *app_source_fh, *garbage_fh;
     chaz_bool_t successful;
     OperSys *os = self->os;
     char *exe_full_filepath = NULL;
@@ -109,7 +106,6 @@
 compile_obj(Compiler *self, const char *source_path, const char *obj_path, 
             const char *code, size_t code_len)
 {
-    FILE *app_source_fh, *garbage_fh;
     chaz_bool_t successful;
     OperSys *os = self->os;
     char *obj_full_filepath = NULL;

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.harm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.harm?view=diff&rev=467768&r1=467767&r2=467768
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.harm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.harm Wed Oct 25 14:11:34 2006
@@ -48,7 +48,8 @@
 /** Constructor.
  */
 chaz_Compiler*
-chaz_CC_new(struct chaz_OperSys *oper_sys, char *cc_command, char *cc_flags);
+chaz_CC_new(struct chaz_OperSys *oper_sys, const char *cc_command, 
+            const char *cc_flags);
 
 #ifdef CHAZ_USE_SHORT_NAMES
 # define Compiler                    chaz_Compiler

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.charm?view=diff&rev=467768&r1=467767&r2=467768
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Core/ModHandler.charm Wed Oct 25 14:11:34
2006
@@ -46,8 +46,6 @@
 void
 chaz_ModHand_init()
 {
-    size_t len;
-
     /* set the name of the application which we "try" to execute */
     (void)join_strings(&try_app_path, 0, TRY_APP_BASENAME, os->exe_ext, NULL);
 
@@ -94,6 +92,9 @@
             command_len += strlen(argv[i]) + 1;
         }
         command = (char*)calloc(command_len, sizeof(char));
+METAQUOTE;
+
+static char charm_run_code_b[] = METAQUOTE
         if (command == NULL) {
             fprintf(stderr, "calloc failed\n");
             exit(1);
@@ -106,7 +107,7 @@
         freopen( 
 METAQUOTE;
 
-static char charm_run_code_b[] = METAQUOTE
+static char charm_run_code_c[] = METAQUOTE
              , "w", stderr);
 
         /* run the commmand and return its value to the parent process */
@@ -120,8 +121,8 @@
     char *code = NULL;
     chaz_bool_t compile_succeeded = false;
 
-    (void)join_strings(&code, 0, charm_run_code_a, " \"", os->devnull, "\" ",
-        charm_run_code_b, NULL);
+    (void)join_strings(&code, 0, charm_run_code_a, charm_run_code_b, " \"", 
+        os->devnull, "\" ", charm_run_code_c, NULL);
 
     compile_succeeded = compiler->compile_exe(compiler, "_charm_run.c", 
         "_charm_run", code, strlen(code));

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/Integers.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/Integers.charm?view=diff&rev=467768&r1=467767&r2=467768
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/Integers.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/Integers.charm Wed Oct 25 14:11:34
2006
@@ -43,7 +43,6 @@
     int main() 
     {
         Charm_Setup;
-        long long foo = 4;
         printf("%d", (int)sizeof(long long));
         return 0;
     }

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/LargeFiles.harm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/LargeFiles.harm?view=diff&rev=467768&r1=467767&r2=467768
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/LargeFiles.harm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Modules/LargeFiles.harm Wed Oct 25 14:11:34
2006
@@ -11,7 +11,7 @@
  * If support for large files is detected, these symbols will be defined.
  *
  * HAS_LARGE_FILE_SUPPORT
- * LOFFSET_TYPE 
+ * loff_t 
  * Lftell
  * Lfseek
  *

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/FuncMacro.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/FuncMacro.charm?view=diff&rev=467768&r1=467767&r2=467768
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/FuncMacro.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/FuncMacro.charm Wed Oct 25 14:11:34
2006
@@ -1,6 +1,7 @@
 #define CHAZ_USE_SHORT_NAMES
 
 #include "_charm_test.h"
+#include <string.h>
 #include "Charmonizer/Test/TestHandler.h"
 
 void 

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/Integers.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/Integers.charm?view=diff&rev=467768&r1=467767&r2=467768
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/Integers.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/Integers.charm Wed Oct 25 14:11:34
2006
@@ -2,7 +2,8 @@
 
 #include "Charmonizer/Test/TestHandler.h"
 #include "_charm_test.h"
-
+#include <stdio.h>
+#include <string.h>
 
 void 
 chaz_TestHand_test_Integers(int *num_tests, int *num_passed, int *num_failed, 

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/UnusedVars.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/UnusedVars.charm?view=diff&rev=467768&r1=467767&r2=467768
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/UnusedVars.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/UnusedVars.charm Wed Oct 25 14:11:34
2006
@@ -7,14 +7,14 @@
 chaz_TestHand_test_UnusedVars(int *num_tests, int *num_passed, 
                               int *num_failed, int *num_skipped)
 {
+    chaz_bool_t unused_var_is_defined = false;
+    chaz_bool_t unreach_is_defined = false;
     int test_num  = 0;
+
     *num_tests    = 2;
     *num_passed   = 0;
     *num_failed   = 0;
     *num_skipped  = *num_tests;
-
-    chaz_bool_t unused_var_is_defined = false;
-    chaz_bool_t unreach_is_defined = false;
 
 #ifdef Unused_Var
     unused_var_is_defined = true;

Modified: lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/VariadicMacros.charm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/VariadicMacros.charm?view=diff&rev=467768&r1=467767&r2=467768
==============================================================================
--- lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/VariadicMacros.charm (original)
+++ lucene/lucy/trunk/charmonizer/src/Charmonizer/Test/VariadicMacros.charm Wed Oct 25 14:11:34
2006
@@ -1,21 +1,22 @@
 #define CHAZ_USE_SHORT_NAMES
 
 #include "_charm_test.h"
-#include "string.h"
+#include <string.h>
+#include <stdio.h>
 #include "Charmonizer/Test/TestHandler.h"
 
 void 
 chaz_TestHand_test_VariadicMacros(int *num_tests, int *num_passed, 
                                   int *num_failed, int *num_skipped)
 {
+    char buf[10];
+    chaz_bool_t really_has_var_macs = false;
     int test_num  = 0;
+
     *num_tests    = 4;
     *num_passed   = 0;
     *num_failed   = 0;
     *num_skipped  = *num_tests;
-    char buf[10];
-    chaz_bool_t really_has_var_macs = false;
-    int i;
 
 #if defined(HAS_ISO_VARIADIC_MACROS) || defined(HAS_GNUC_VARIADIC_MACROS)
   #ifdef HAS_VARIADIC_MACROS



Mime
View raw message