]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
SourceFormat: report broken file and continue after errors.
authorAmos Jeffries <amosjeffries@squid-cache.org>
Sun, 23 Aug 2009 03:08:22 +0000 (21:08 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Sun, 23 Aug 2009 03:08:22 +0000 (21:08 -0600)
compat/GnuRegex.h
compat/assert.h
compat/os/mswin.h
scripts/formater.pl
scripts/srcformat.sh

index 660e8ac3026b4190e488c4b079aa1f4d408e15ee..b805f99f6a2e5e938cf0e1e5b9b6472e036bdf25 100644 (file)
@@ -23,8 +23,7 @@
 #else  /* USE_GNUREGEX */
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
     /* Definitions for data structures and routines for the regular
@@ -418,12 +417,8 @@ extern "C"
 
     /* POSIX compatibility.  */
     extern int regcomp _RE_ARGS((regex_t * preg, const char *pattern, int cflags));
-    extern int regexec
-        _RE_ARGS((const regex_t * preg, const char *string, size_t nmatch,
-                  regmatch_t pmatch[], int eflags));
-    extern size_t regerror
-        _RE_ARGS((int errcode, const regex_t * preg, char *errbuf,
-                  size_t errbuf_size));
+    extern int regexec _RE_ARGS((const regex_t * preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags));
+    extern size_t regerror _RE_ARGS((int errcode, const regex_t * preg, char *errbuf, size_t errbuf_size));
     extern void regfree _RE_ARGS((regex_t * preg));
 
 #ifdef __cplusplus
index acb01453c099e76bf6968b99a02605343ba7c89a..1bad0a026f20527d15740855d2b09d0fa82dc04e 100644 (file)
@@ -51,6 +51,6 @@ extern "C" void
 #else
 extern void
 #endif
-    xassert(const char *, const char *, int);
+xassert(const char *, const char *, int);
 
 #endif /* SQUID_ASSERT_H */
index 17467f5bf2711ee40f51d938bf07bcd3f29411e8..2c3944ab13ea44a8cf8197d2862054cc8804fbdd 100644 (file)
@@ -661,7 +661,8 @@ int WSADuplicateSocket(int s, DWORD n, LPWSAPROTOCOL_INFO l)
 
 #undef WSASocket
 inline
-int WSASocket(int a, int t, int p, LPWSAPROTOCOL_INFO i, GROUP g, DWORD f) {
+int WSASocket(int a, int t, int p, LPWSAPROTOCOL_INFO i, GROUP g, DWORD f)
+{
     SOCKET result;
 #ifdef UNICODE
     if ((result = ::WSASocketW(a, t, p, i, g, f)) == INVALID_SOCKET) {
index 40a92a103254a5de6b72dd2977ee3ff8fe0b3965..2f6216edfd99d19d0512220b79acc1c44a1cb1b7 100755 (executable)
@@ -25,14 +25,12 @@ use IPC::Open2;
 #
 # NP: The Squid code requires astyle version 1.22 or later
 #
-#$ASTYLE_BIN="/usr/local/bin/astyle";
-$ASTYLE_BIN="/usr/bin/astyle";
-
+$ASTYLE_BIN="/usr/local/bin/astyle";
+#$ASTYLE_BIN="/usr/bin/astyle";
 #$ASTYLE_BIN="/usr/local/src/astyle-1.22/bin/astyle";
-$ASTYLE_ARGS ="--mode=c -s4 -O -l";
 
+$ASTYLE_ARGS ="--mode=c -s4 -O -l";
 #$ASTYLE_ARGS="--mode=c -s4 -O --break-blocks -l";
-#$ASTYLE_BIN="/usr/local/src/astyle-1.22/bin/astyle";
 
 
 if(! -e $ASTYLE_BIN){
@@ -83,8 +81,7 @@ while($out){
        print "An error while open2\n";
        exit -1;
     }
-    
-    
+
     if($pid=fork()){
        #do parrent staf
        close(FROM_ASTYLE);
@@ -111,7 +108,7 @@ while($out){
     else{
        # child staf
        close(TO_ASTYLE);
-       
+
        if(!open(OUT,">$out")){
            print "Can't open output file: $out\n";
            exit -1;
@@ -142,7 +139,7 @@ sub input_filter{
 
     if($$line =~/\s+int\s+.*/s || $$line=~ /\s+unsigned\s+.*/s ||
        $$line =~/^int\s+.*/s || $$line=~ /^unsigned\s+.*/s
-       ){ 
+       ){
        if( $$line =~ /(\(|,|\)|\#|typedef)/s ){
            #excluding int/unsigned appeared inside function prototypes,typedefs etc....
            return 1;
@@ -159,12 +156,12 @@ sub input_filter{
             $prx =~ s/\s*$//g;
            $$line= $prx." int ".$name."__FORASTYLE__".$val.";".$extra;
 #          print "----->".$$line."\n";
-       }       
+       }
        elsif($$line =~ /\s*unsigned\s+([^:]*):\s*(\w+)\s*\;(.*)/s){
             local($name,$val,$extra)=($1,$2,$3);
             $prx =~ s/\s*$//g;
            $$line= "unsigned ".$name."__FORASTYLE__".$val.";".$extra;
-       }       
+       }
        return 1;
     }
 
index ffe5efe9c62f69e9ce964092c197029641c5110e..659c8a4c5dbb8df9d452b27ca3ccbedbc9caadcd 100755 (executable)
@@ -30,12 +30,12 @@ for FILENAME in `ls -1`; do
                md52=`cat  $FILENAME.astylebak| tr -d "\n \t\r" | $MD5`;
 
                if test "$md51" != "$md52" ; then
-                       echo "File $PWD/$FILENAME not converted well";
+                       echo "ERROR: File $PWD/$FILENAME not formating well";
                        mv $FILENAME $FILENAME.astylebad
                        mv $FILENAME.astylebak $FILENAME
-                       exit 1;
+               else
+                       rm $FILENAME.astylebak
                fi
-               rm $FILENAME.astylebak
                continue;
         fi
     esac