瀏覽代碼

Avoid some empty if- and else- parts. gcc -Wall does not like it

ceriel 30 年之前
父節點
當前提交
a1a816ddc2
共有 2 個文件被更改,包括 10 次插入7 次删除
  1. 3 3
      util/LLgen/lib/incl
  2. 7 4
      util/LLgen/lib/rec

+ 3 - 3
util/LLgen/lib/incl

@@ -10,11 +10,11 @@
 extern int LLsymb;
 
 #define LL_SAFE(x)	/* Nothing */
-#define LL_SSCANDONE(x)	if (LLsymb != x) LLsafeerror(x); else
-#define LL_SCANDONE(x)	if (LLsymb != x) LLerror(x); else
+#define LL_SSCANDONE(x)	if (LLsymb != x) LLsafeerror(x)
+#define LL_SCANDONE(x)	if (LLsymb != x) LLerror(x)
 #define LL_NOSCANDONE(x) LLscan(x)
 #ifdef LL_FASTER
-#define LLscan(x)	if ((LLsymb = LL_LEXI()) != x) LLerror(x); else
+#define LLscan(x)	if ((LLsymb = LL_LEXI()) != x) LLerror(x)
 #endif
 
 extern unsigned int LLscnt[];

+ 7 - 4
util/LLgen/lib/rec

@@ -13,7 +13,10 @@ int		LLcsymb, LLsymb;
 static int	LLlevel;
 
 #if LL_ANSI_C
+#define LL_VOIDCST (void)
 void	LLmessage(int);
+#else
+#define LL_VOIDCST
 #endif
 #ifdef LL_USERHOOK
 #if LL_ANSI_C
@@ -72,7 +75,7 @@ LLerror(t)
 	if (t == EOFILE) {
 #ifdef LL_USERHOOK
 		static int lst[] = { EOFILE, 0 };
-		if (LLuserhook(EOFILE, lst)) /* nothing */;
+		LL_VOIDCST LLuserhook(EOFILE, lst);
 #endif /* LL_USERHOOK */
 		if (LLsymb != EOFILE && LLsymb > 0) {
 			LLmessage(-1);
@@ -89,9 +92,9 @@ LLerror(t)
 	i = LLindex[t];
 	LLtcnt[i]++;
 #ifdef LL_USERHOOK
-	if (LLdoskip(t)) /* nothing */;
+	LL_VOIDCST LLdoskip(t);
 #else
-	if (LLskip()) /* nothing */;
+	LL_VOIDCST LLskip();
 #endif
 	LLtcnt[i]--;
 	if (LLsymb != t) LLmessage(t);
@@ -109,7 +112,7 @@ LLsafeerror(t)
 	if (t == EOFILE) {
 #ifdef LL_USERHOOK
 		static int lst[] = { EOFILE, 0 };
-		if (LLuserhook(EOFILE, lst)) /* nothing */;
+		LL_VOIDCST LLuserhook(EOFILE, lst);
 #endif /* LL_USERHOOK */
 		if (LLsymb != EOFILE && LLsymb > 0) {
 			LLmessage(-1);