File: 09-Stop-using-true-and-false-as-label-names-in-system.c.patch

package info (click to toggle)
mcpp 2.7.2-5.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,440 kB
  • sloc: ansic: 35,245; sh: 9,241; makefile: 116; cpp: 84; exp: 18
file content (52 lines) | stat: -rw-r--r-- 1,712 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From: John Brandwood <john.brandwood@telzey.com>
Date: Fri, 9 May 2025 11:24:24 -0400
Subject: Stop using "true" and "false" as label names in system.c, it breaks
 modern C!
Origin: https://github.com/jbrandwood/mcpp.git/commit/1d65736ca2c10328916ed6c98e6422a784da187a

---
 src/system.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/system.c b/src/system.c
index cb21e99..a6ff95b 100644
--- a/src/system.c
+++ b/src/system.c
@@ -3450,7 +3450,7 @@ search:
     if (! fullname)                 /* Non-existent or directory    */
         return  FALSE;
     if (standard && included( fullname))        /* Once included    */
-        goto  true;
+        return  TRUE;
         
     if ((max_open != 0 && max_open <= include_nest)
                             /* Exceed the known limit of open files */
@@ -3477,12 +3477,12 @@ search:
         if ((fp = fopen( fullname, "r")) == NULL) {
             file->fp = fopen( cur_fullname, "r");
             fseek( file->fp, file->pos, SEEK_SET);
-            goto  false;
+            goto  failed;
         }
         if (max_open == 0)      /* Remember the limit of the system */
             max_open = include_nest;
     } else if (fp == NULL)                  /* No read permission   */ 
-        goto  false;
+        goto  failed;
     /* Truncate buffer of the includer to save memory   */
     len = (int) (file->bptr - file->buffer);
     if (len) {
@@ -3529,9 +3529,8 @@ search:
     if (mkdep && ((mkdep & MD_SYSHEADER) || ! infile->sys_header))
         put_depend( fullname);          /* Output dependency line   */
 
-true:
     return  TRUE;
-false:
+failed:
     free( fullname);
     return  FALSE;
 }
-- 
2.51.0