File mcpp-2.7.2.1.diff of Package mcpp
Index: mcpp-2.7.2.1/src/system.c
===================================================================
--- mcpp-2.7.2.1.orig/src/system.c
+++ mcpp-2.7.2.1/src/system.c
@@ -43,6 +43,8 @@
-#include "internal.H"
-#endif
-
+#include "internal.H"
+#endif
+
+#include <unistd.h>
+
#if HOST_SYS_FAMILY == SYS_UNIX
-#include "unistd.h" /* For getcwd(), readlink() */
+#include "unistd.h" /* For getcwd(), readlink() */
#elif HOST_COMPILER == MSC || HOST_COMPILER == LCC
-#include "direct.h"
-#define getcwd( buf, size) _getcwd( buf, size)
+#include "direct.h"
+#define getcwd( buf, size) _getcwd( buf, size)
#elif HOST_COMPILER == BORLANDC
-#include "dir.h"
+#include "dir.h"
#endif
@@ -1527,7 +1529,7 @@ static int open_file(
- fullname = norm_path( *dirp, fname, TRUE, FALSE);
- /* Convert to absolute path */
- if (! fullname) /* Non-existent or directory */
- return FALSE;
- if (standard && included( fullname)) /* Once included */
- goto true;
+ fullname = norm_path( *dirp, fname, TRUE, FALSE);
+ /* Convert to absolute path */
+ if (! fullname) /* Non-existent or directory */
+ return FALSE;
+ if (standard && included( fullname)) /* Once included */
+ goto open_success;
- if ((max_open != 0 && max_open <= include_nest)
- /* Exceed the known limit of open files */
- || ((fp = fopen( fullname, "r")) == NULL && errno == EMFILE)) {
+ if ((max_open != 0 && max_open <= include_nest)
+ /* Exceed the known limit of open files */
+ || ((fp = fopen( fullname, "r")) == NULL && errno == EMFILE)) {
@@ -1559,7 +1561,7 @@ static int open_file(
- file->fp = fopen( cur_fullname, "r");
- fseek( file->fp, file->pos, SEEK_SET);
- goto false;
+ file->fp = fopen( cur_fullname, "r");
+ fseek( file->fp, file->pos, SEEK_SET);
+ goto open_fail;
}
- if (max_open == 0) /* Remember the limit of the system */
- max_open = include_nest;
- } else if (fp == NULL) /* No read permission */
- goto false;
+ if (max_open == 0) /* Remember the limit of the system */
+ max_open = include_nest;
+ } else if (fp == NULL) /* No read permission */
+ goto open_fail;
/* Truncate buffer of the includer to save memory */
- len = (int) (file->bptr - file->buffer);
- if (len) {
- file->buffer = xrealloc( file->buffer, len + 1);
- file->bptr = file->buffer + len;
+ len = (int) (file->bptr - file->buffer);
+ if (len) {
+ file->buffer = xrealloc( file->buffer, len + 1);
+ file->bptr = file->buffer + len;
@@ -1596,10 +1598,10 @@ static int open_file(
- if (mkdep && ((mkdep & MD_SYSHEADER) || ! infile->sys_header))
- put_depend( fullname); /* Output dependency line */
-
-true:
- return TRUE;
-false:
- free( fullname);
- return FALSE;
+ if (mkdep && ((mkdep & MD_SYSHEADER) || ! infile->sys_header))
+ put_depend( fullname); /* Output dependency line */
+
+open_success:
+ return TRUE;
+open_fail:
+ free( fullname);
+ return FALSE;
Index: mcpp-2.7.2.1/src/expand.c
===================================================================
--- mcpp-2.7.2.1.orig/src/expand.c
+++ mcpp-2.7.2.1/src/expand.c
@@ -710,7 +710,8 @@ static char * replace(
- } else {
- m_inf->locs.start_col = m_inf->locs.start_line = 0L;
- }
- m_inf->args = m_inf->loc_args = NULL; /* Default args */
+ } else {
+ m_inf->locs.start_col = m_inf->locs.start_line = 0L;
+ }
+ m_inf->args = NULL; /* Default args */
+ m_inf->loc_args = NULL;
for (num = 1, recurs = 0; num < m_num; num++)
- if (mac_inf[ num].defp == defp)
- recurs++; /* Recursively nested macro */
+ if (mac_inf[ num].defp == defp)
+ recurs++; /* Recursively nested macro */
Index: mcpp-2.7.2.1/src/eval.c
===================================================================
--- mcpp-2.7.2.1.orig/src/eval.c
+++ mcpp-2.7.2.1/src/eval.c
@@ -1281,7 +1281,7 @@ static expr_t eval_eval(
-#if COMPILER == GNUC || COMPILER == MSC
- CERROR( "overflowed by int to unsigned long long conversion"
- , 0L, NULL, 0);
- MCPP_WARN( 1, "Negative value \"%" LL_FORM "d\" is converted to positive \"%" LL_FORM "u\"",
- (long) tmp1, (ull) (tmp1));
-#endif
- tmp1 = (uexpr_t) tmp1;
+#if COMPILER == GNUC || COMPILER == MSC
+ CERROR( "overflowed by int to unsigned long long conversion"
+ , 0L, NULL, 0);
+ MCPP_WARN( 1, "Negative value \"%" LL_FORM "d\" is converted to positive \"%" LL_FORM "u\"",
+ (long) tmp1, (ull) (tmp1));
+#endif
+ tmp1 = (uexpr_t) tmp1;
@@ -1635,7 +1635,7 @@ static void dump_val(
- if (dump)
- dump1 = "%s(%ssigned long long) %lld"; /* For MinGW */
- else
- dump1 = "%s(%ssigned long long) 0x%016" LL_FORM "x";
+ if (dump)
+ dump1 = "%s(%ssigned long long) %lld"; /* For MinGW */
+ else
+ dump1 = "%s(%ssigned long long) 0x%016" LL_FORM "x";
break;
case T_LONG: dump1 = "%s(%ssigned long) %ld"; break;
case T_INT: dump1 = "%s(%ssigned int) %d"; break;