]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Added style + indent rule, fixed some indenting as well
authorDale Weiler <killfieldengine@gmail.com>
Mon, 19 Aug 2013 02:16:16 +0000 (02:16 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Mon, 19 Aug 2013 02:16:16 +0000 (02:16 +0000)
ftepp.c
include.mk
test.c

diff --git a/ftepp.c b/ftepp.c
index e79dcd751c46db36506665524966b623f588b89b..5f414f358bb868df23815d875d0579ad9067ac41 100644 (file)
--- a/ftepp.c
+++ b/ftepp.c
@@ -184,7 +184,7 @@ static char *ftepp_predef_timestamp(lex_file *context) {
     char       *value;
     size_t      size;
 #ifdef _MSC_VER
-       char        buffer[64];
+    char        buffer[64];
 #endif
     if (stat(context->name, &finfo))
         return util_strdup("\"<failed to determine timestamp>\"");
@@ -197,8 +197,8 @@ static char *ftepp_predef_timestamp(lex_file *context) {
 #ifndef _MSC_VER
     find  = ctime(&finfo.st_mtime);
 #else
-       ctime_s(buffer, sizeof(buffer), &finfo.st_mtime);
-       find = buffer;
+    ctime_s(buffer, sizeof(buffer), &finfo.st_mtime);
+    find = buffer;
 #endif
 
     value = (char*)mem_a(strlen(find) + 1);
index 7624473d886f8b146e144068a74e6acc6790c508..30372896beaae36558e9daa169d22f7f7b36e2fe 100644 (file)
@@ -108,9 +108,13 @@ uninstall:
        rm -f $(DESTDIR)$(MANDIR)/man1/doc/qcvm.1
        rm -f $(DESTDIR)$(MANDIR)/man1/doc/gmqpak.1
 
-whitespace:
-       find . -type f \( -name '*.[ch]' -or -name '*.def' \) -exec sed -i 's/ *$$//' '{}' ';'
+STYLE_MATCH = \( -name '*.[ch]' -or -name '*.def' \)
 
+whitespace:
+       find . -type f $(STYLE_MATCH) -exec sed -i 's/ *$$//' '{}' ';'
 newline:
-       find . -type f \( -name '*.[ch]' -or -name '*.def' \) -exec sed -i -e '$$a\' '{}' ';'
+       find . -type f $(STYLE_MATCH) -exec sed -i -e '$$a\' '{}' ';'
+indent:
+       find . -type f $(STYLE_MATCH) -exec sed -i 's/\t/    /g' '{}' ';'
 
+style: whitespace newline indent
diff --git a/test.c b/test.c
index f3aa6bb43e3cc9b0b217b3071a18a1367ab41a12..64c9928e7fc2c82eb8a01dc9d2bdabb0fd1bb7c1 100644 (file)
--- a/test.c
+++ b/test.c
@@ -166,8 +166,8 @@ static int task_pclose(FILE **handles) {
         tmpnam(open->name_err);
         tmpnam(open->name_out);
 #else
-               tmpnam_s(open->name_err, L_tmpnam);
-               tmpnam_s(open->name_out, L_tmpnam);
+        tmpnam_s(open->name_err, L_tmpnam);
+        tmpnam_s(open->name_out, L_tmpnam);
 #endif
 
         (void)mode; /* excluded */
@@ -193,8 +193,8 @@ static int task_pclose(FILE **handles) {
 
         mem_d(open);
     }
-#      define popen _popen
-#      define pclose _pclose
+#   define popen _popen
+#   define pclose _pclose
 #endif /*! _WIN32 */
 
 #define TASK_COMPILE    0