Relayouted all switch statements: case aligns with switch.
[mmh] / uip / annosbr.c
index e48f7d9..e8c03e1 100644 (file)
@@ -39,12 +39,12 @@ annotate(char *file, char *comp, char *text, int inplace, int datesw,
        /* open and lock the file to be annotated */
        if ((fd = lkopen(file, O_RDWR, 0)) == NOTOK) {
                switch (errno) {
-                       case ENOENT:
-                               break;
+               case ENOENT:
+                       break;
 
-                       default:
-                               admonish(file, "unable to lock and open");
-                               break;
+               default:
+                       admonish(file, "unable to lock and open");
+                       break;
                }
                return 1;
        }
@@ -113,7 +113,7 @@ annolist(char *file, char *comp, char *text, int number)
 
                for (n = 0, cp = field; (c = getc(fp)) != EOF; *cp++ = c) {
                        if (c == '\n' && (c = getc(fp)) != ' ' && c != '\t') {
-                               (void)ungetc(c, fp);
+                               ungetc(c, fp);
                                c = '\n';
                                break;
                        }
@@ -133,19 +133,19 @@ annolist(char *file, char *comp, char *text, int number)
                                ;
 
                        if (number)
-                               (void)printf("%d\t", ++count);
+                               printf("%d\t", ++count);
 
-                       if (text == (char *)0 && (sp = strrchr(cp, '/')) != (char *)0)
+                       if (text == NULL && (sp = strrchr(cp, '/')) != NULL)
                                cp = sp + 1;
 
-                       (void)printf("%s\n", cp);
+                       printf("%s\n", cp);
                }
 
        } while (*field != '\0' && *field != '-');
 
        /* Clean up. */
        free(field);
-       (void)fclose(fp);
+       fclose(fp);
 
        return;
 }
@@ -247,7 +247,7 @@ annosbr(int fd, char *file, char *comp, char *text, int inplace,
 
                        for (n = 0, cp = field; (c = getc(fp)) != EOF; *cp++ = c) {
                                if (c == '\n' && (c = getc(fp)) != ' ' && c != '\t') {
-                                       (void)ungetc(c, fp);
+                                       ungetc(c, fp);
                                        c = '\n';
                                        break;
                                }
@@ -297,7 +297,7 @@ annosbr(int fd, char *file, char *comp, char *text, int inplace,
 
                        if (strncasecmp(field, comp, length) == 0 && field[length] == ':') {
                                if (delete == 0) {
-                                       if (text == (char *)0)
+                                       if (text == NULL)
                                                break;
 
                                        for (cp = field + length + 1; *cp == ' ' || *cp == '\t'; cp++)
@@ -308,7 +308,7 @@ annosbr(int fd, char *file, char *comp, char *text, int inplace,
                                                                break;
                                        }
                                        else {
-                                               if ((sp = strrchr(cp, '/')) != (char *)0)
+                                               if ((sp = strrchr(cp, '/')) != NULL)
                                                        cp = sp + 1;
 
                                                if (strcmp(cp, text) == 0)
@@ -357,13 +357,13 @@ annosbr(int fd, char *file, char *comp, char *text, int inplace,
                                rewind(fp);
 
                        else {
-                               (void)putc(c, tmp);
+                               putc(c, tmp);
 
                                while ((c = getc(fp)) != EOF) {
-                                       (void)putc(c, tmp);
+                                       putc(c, tmp);
 
                                        if (c == '\n') {
-                                               (void)ungetc(c = getc(fp), fp);
+                                               ungetc(c = getc(fp), fp);
 
                                                if (c == '\n' || c == '-')
                                                        break;
@@ -428,13 +428,14 @@ annosbr(int fd, char *file, char *comp, char *text, int inplace,
                strncpy(buffer, m_backup(file), sizeof(buffer));
                if (rename(file, buffer) == NOTOK) {
                        switch (errno) {
-                               case ENOENT:  /* unlinked early - no annotations */
-                                       unlink(tmpfil);
-                                       break;
+                       case ENOENT:  /* unlinked early - no annotations */
+                               unlink(tmpfil);
+                               break;
 
-                               default:
-                                       admonish(buffer, "unable to rename %s to", file);
-                                       break;
+                       default:
+                               admonish(buffer, "unable to rename %s to",
+                                               file);
+                               break;
                        }
                        return 1;
                }
@@ -451,7 +452,7 @@ annosbr(int fd, char *file, char *comp, char *text, int inplace,
        */
 
        if (delete >= -1)
-               (void)fclose(fp);
+               fclose(fp);
 
        return 0;
 }