texlive[57392] Build/source/texk/web2c/mfluadir: using -std=c99 for

commits+lscarso at tug.org commits+lscarso at tug.org
Tue Jan 12 01:14:13 CET 2021


Revision: 57392
          http://tug.org/svn/texlive?view=revision&revision=57392
Author:   lscarso
Date:     2021-01-12 01:14:12 +0100 (Tue, 12 Jan 2021)
Log Message:
-----------
using -std=c99 for MFLua 

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/mfluadir/am/mfluaotfcc.am
    trunk/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.c
    trunk/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.h
    trunk/Build/source/texk/web2c/mfluadir/otfcc/lib/vf/region.c
    trunk/Build/source/texk/web2c/mfluadir/otfcc/src/luafunc.c

Modified: trunk/Build/source/texk/web2c/mfluadir/am/mfluaotfcc.am
===================================================================
--- trunk/Build/source/texk/web2c/mfluadir/am/mfluaotfcc.am	2021-01-11 22:45:03 UTC (rev 57391)
+++ trunk/Build/source/texk/web2c/mfluadir/am/mfluaotfcc.am	2021-01-12 00:14:12 UTC (rev 57392)
@@ -14,7 +14,7 @@
 $(libmfluajitotfcc_a_OBJECTS): $(LUAJIT_DEPEND)
 
 libmfluaotfcc_a_CPPFLAGS = \
-	-D_CARYLL_USE_PRE_SERIALIZED -DMAIN_VER=0 -DSECONDARY_VER=10 -DPATCH_VER=4 \
+	-std=c99 -D_CARYLL_USE_PRE_SERIALIZED -DMAIN_VER=0 -DSECONDARY_VER=10 -DPATCH_VER=4 \
 	-I$(top_srcdir)/mfluadir/otfcc/include \
 	-I$(top_srcdir)/mfluadir/otfcc/include/dep \
 	-I$(top_srcdir)/mfluadir/otfcc/lib \
@@ -22,7 +22,7 @@
 
 
 libmfluajitotfcc_a_CPPFLAGS = \
-	-D_CARYLL_USE_PRE_SERIALIZED -DMAIN_VER=0 -DSECONDARY_VER=10 -DPATCH_VER=4 \
+	-std=c99 -D_CARYLL_USE_PRE_SERIALIZED -DMAIN_VER=0 -DSECONDARY_VER=10 -DPATCH_VER=4 \
 	-DJIT \
 	-I$(top_srcdir)/mfluadir/otfcc/include \
 	-I$(top_srcdir)/mfluadir/otfcc/include/dep \
@@ -44,12 +44,8 @@
 	mfluadir/otfcc/dep/extern/sds.c \
 	mfluadir/otfcc/src/aliases.h \
 	mfluadir/otfcc/src/luafunc.c \
-	mfluadir/otfcc/src/otfccbuild.c \
-	mfluadir/otfcc/src/otfccdump.c \
 	mfluadir/otfcc/src/platform.h \
 	mfluadir/otfcc/src/otfccdll.c \
-	mfluadir/otfcc/src/stopwatch.c \
-	mfluadir/otfcc/src/stopwatch.h \
 	mfluadir/otfcc/include/dep/json.h \
 	mfluadir/otfcc/include/dep/json-builder.h \
 	mfluadir/otfcc/include/dep/sds.h \

Modified: trunk/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.c
===================================================================
--- trunk/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.c	2021-01-11 22:45:03 UTC (rev 57391)
+++ trunk/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.c	2021-01-12 00:14:12 UTC (rev 57392)
@@ -26,7 +26,7 @@
 		HASH_FIND_STR(h, k, e);
 		if (!e) {
 			NEW(e);
-			e->key = strdup(k);
+			e->key = xstrdup(k);
 			e->val = a->u.object.values[j].value;
 			e->check = false;
 			HASH_ADD_STR(h, key, e);

Modified: trunk/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.h
===================================================================
--- trunk/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.h	2021-01-11 22:45:03 UTC (rev 57391)
+++ trunk/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.h	2021-01-12 00:14:12 UTC (rev 57392)
@@ -9,4 +9,5 @@
 
 bool json_ident(const json_value *a, const json_value *b);
 
+extern char *xstrdup(const char *);
 #endif

Modified: trunk/Build/source/texk/web2c/mfluadir/otfcc/lib/vf/region.c
===================================================================
--- trunk/Build/source/texk/web2c/mfluadir/otfcc/lib/vf/region.c	2021-01-11 22:45:03 UTC (rev 57391)
+++ trunk/Build/source/texk/web2c/mfluadir/otfcc/lib/vf/region.c	2021-01-12 00:14:12 UTC (rev 57392)
@@ -51,12 +51,12 @@
 		return (z - x) / (z - p);
 	}
 }
-static pos_t vqRegionGetWeight(const vq_Region *r, const VV *v) {
-	pos_t w = 1;
-	for (size_t j = 0; j < r->dimensions && v->length; j++) {
-		w *= weightAxisRegion(&r->spans[j], v->items[j]);
-	}
-	return w;
-}
+//static pos_t vqRegionGetWeight(const vq_Region *r, const VV *v) {
+//	pos_t w = 1;
+//	for (size_t j = 0; j < r->dimensions && v->length; j++) {
+//		w *= weightAxisRegion(&r->spans[j], v->items[j]);
+//	}
+//	return w;
+//}
 
 void vq_showRegion(const vq_Region *r) {}

Modified: trunk/Build/source/texk/web2c/mfluadir/otfcc/src/luafunc.c
===================================================================
--- trunk/Build/source/texk/web2c/mfluadir/otfcc/src/luafunc.c	2021-01-11 22:45:03 UTC (rev 57391)
+++ trunk/Build/source/texk/web2c/mfluadir/otfcc/src/luafunc.c	2021-01-12 00:14:12 UTC (rev 57392)
@@ -4,7 +4,7 @@
 #include "otfcc/sfnt-builder.h"
 #include "aliases.h"
 #include "platform.h"
-#include "stopwatch.h"
+//#include "stopwatch.h"
 
 #include <unistd.h>
 
@@ -14,6 +14,7 @@
 int otfcc_build(int b_argc, char *b_argv[]);
 int otfcc_dump(int b_argc, char *b_argv[]);
 
+extern char *xstrdup(const char *);
 
 
 #ifndef MAIN_VER
@@ -138,8 +139,8 @@
 
 
 int otfcc_build(int b_argc, char *b_argv[]) {
-	struct timespec begin;
-	time_now(&begin);
+//	struct timespec begin;
+//	time_now(&begin);
 
 	bool show_help = false;
 	bool show_version = false;
@@ -293,7 +294,7 @@
 				build_readEntireStdin(&buffer, &length);
 			}*/
 		}
-		logStepTime;
+		//logStepTime;
 	}
 
 	json_value *jsonRoot = NULL;
@@ -300,7 +301,7 @@
 	loggedStep("Parse into JSON") {
 		jsonRoot = json_parse(buffer, length);
 		free(buffer);
-		logStepTime;
+		//logStepTime;
 		if (!jsonRoot) {
 			logError("Cannot parse JSON file \"%s\". Exit.\n", inPath);
 			exit(EXIT_FAILURE);
@@ -317,11 +318,11 @@
 		}
 		parser->free(parser);
 		json_value_free(jsonRoot);
-		logStepTime;
+		//logStepTime;
 	}
 	loggedStep("Consolidate") {
 		otfcc_iFont.consolidate(font, options);
-		logStepTime;
+		//logStepTime;
 	}
 	loggedStep("Build") {
 		otfcc_IFontSerializer *writer = otfcc_newOTFWriter();
@@ -335,7 +336,7 @@
 			fwrite(otf->data, sizeof(uint8_t), buflen(otf), outfile);
 			fclose(outfile);
 		}
-		logStepTime;
+		//logStepTime;
 		buffree(otf), writer->free(writer), otfcc_iFont.free(font), sdsfree(outputPath);
 	}
 	otfcc_deleteOptions(options);
@@ -421,7 +422,7 @@
 				} else if (strcmp(longopts[option_index].name, "instr-as-bytes") == 0) {
 					options->instr_as_bytes = true;
 				} else if (strcmp(longopts[option_index].name, "glyph-name-prefix") == 0) {
-					options->glyph_name_prefix = strdup(optarg);
+					options->glyph_name_prefix = xstrdup(optarg);
 				} else if (strcmp(longopts[option_index].name, "debug-wait-on-start") == 0) {
 					options->debug_wait_on_start = true;
 				}
@@ -473,9 +474,9 @@
 		inPath = sdsnew(b_argv[optind]);
 	}
 
-	struct timespec begin;
+//	struct timespec begin;
 
-	time_now(&begin);
+//	time_now(&begin);
 
 	otfcc_SplineFontContainer *sfnt;
 	loggedStep("Read SFNT") {
@@ -491,7 +492,7 @@
 			         inPath, (sfnt->count - 1));
 			exit(EXIT_FAILURE);
 		}
-		logStepTime;
+		//logStepTime;
 	}
 
 	otfcc_Font *font;
@@ -504,11 +505,11 @@
 		}
 		reader->free(reader);
 		if (sfnt) otfcc_deleteSFNT(sfnt);
-		logStepTime;
+		//logStepTime;
 	}
 	loggedStep("Consolidate") {
 		otfcc_iFont.consolidate(font, options);
-		logStepTime;
+		//logStepTime;
 	}
 	json_value *root;
 	loggedStep("Dump") {
@@ -518,7 +519,7 @@
 			logError("Font structure broken or corrupted \"%s\". Exit.\n", inPath);
 			exit(EXIT_FAILURE);
 		}
-		logStepTime;
+		//logStepTime;
 		dumper->free(dumper);
 	}
 
@@ -529,14 +530,20 @@
 		jsonOptions.mode = json_serialize_mode_packed;
 		jsonOptions.opts = 0;
 		jsonOptions.indent_size = 4;
+#ifdef WIN32
 		if (show_pretty || (!outputPath && isatty(fileno(stdout)))) {
 			jsonOptions.mode = json_serialize_mode_multiline;
 		}
+#else
+		if (show_pretty || (!outputPath && isatty(STDOUT_FILENO))) {
+			jsonOptions.mode = json_serialize_mode_multiline;
+		}
+#endif
 		if (show_ugly) jsonOptions.mode = json_serialize_mode_packed;
 		buflen = json_measure_ex(root, jsonOptions);
 		buf = calloc(1, buflen);
 		json_serialize_ex(buf, root, jsonOptions);
-		logStepTime;
+		//logStepTime;
 	}
 
 	loggedStep("Output") {
@@ -581,6 +588,7 @@
 				fputs(buf, stdout);
 			}
 #else
+			(void)(no_bom);
 			if (add_bom) {
 				fputc(0xEF, stdout);
 				fputc(0xBB, stdout);
@@ -589,7 +597,7 @@
 			fputs(buf, stdout);
 #endif
 		}
-		logStepTime;
+		//logStepTime;
 	}
 
 	loggedStep("Finalize") {
@@ -598,7 +606,7 @@
 		if (root) json_builder_free(root);
 		if (inPath) sdsfree(inPath);
 		if (outputPath) sdsfree(outputPath);
-		logStepTime;
+		//logStepTime;
 	}
 	otfcc_deleteOptions(options);
 



More information about the tex-live-commits mailing list.