summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c
diff options
context:
space:
mode:
authorLuigi Scarso <luigi.scarso@gmail.com>2021-01-12 00:14:12 +0000
committerLuigi Scarso <luigi.scarso@gmail.com>2021-01-12 00:14:12 +0000
commit3f35e49f41be4c9769396bf21f7b9a4e8313b48e (patch)
treedac442e30c6daf36b5d5b092caed96d9b78d12d1 /Build/source/texk/web2c
parent0e88b763ff27e0080e257110badde4da88918d9d (diff)
using -std=c99 for MFLua
git-svn-id: svn://tug.org/texlive/trunk@57392 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r--Build/source/texk/web2c/mfluadir/am/mfluaotfcc.am8
-rw-r--r--Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.c2
-rw-r--r--Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.h1
-rw-r--r--Build/source/texk/web2c/mfluadir/otfcc/lib/vf/region.c14
-rw-r--r--Build/source/texk/web2c/mfluadir/otfcc/src/luafunc.c44
5 files changed, 37 insertions, 32 deletions
diff --git a/Build/source/texk/web2c/mfluadir/am/mfluaotfcc.am b/Build/source/texk/web2c/mfluadir/am/mfluaotfcc.am
index 31b6b1beaf6..04785f1ef74 100644
--- a/Build/source/texk/web2c/mfluadir/am/mfluaotfcc.am
+++ b/Build/source/texk/web2c/mfluadir/am/mfluaotfcc.am
@@ -14,7 +14,7 @@ $(libmfluaotfcc_a_OBJECTS): $(LUA_DEPEND)
$(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 @@ libmfluaotfcc_a_CPPFLAGS = \
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 @@ libmfluaotfcc_a_SOURCES = \
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 \
diff --git a/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.c b/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.c
index 9969e2a57c2..442bd7eeb6c 100644
--- a/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.c
+++ b/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.c
@@ -26,7 +26,7 @@ static bool compare_json_objects(const json_value *a, const json_value *b) {
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);
diff --git a/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.h b/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.h
index c48fd1b6421..ec778d1f48f 100644
--- a/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.h
+++ b/Build/source/texk/web2c/mfluadir/otfcc/lib/support/json/json-ident.h
@@ -9,4 +9,5 @@
bool json_ident(const json_value *a, const json_value *b);
+extern char *xstrdup(const char *);
#endif
diff --git a/Build/source/texk/web2c/mfluadir/otfcc/lib/vf/region.c b/Build/source/texk/web2c/mfluadir/otfcc/lib/vf/region.c
index 61519be1c66..61301273ad0 100644
--- a/Build/source/texk/web2c/mfluadir/otfcc/lib/vf/region.c
+++ b/Build/source/texk/web2c/mfluadir/otfcc/lib/vf/region.c
@@ -51,12 +51,12 @@ static pos_t INLINE weightAxisRegion(const vq_AxisSpan *as, const pos_t x) {
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) {}
diff --git a/Build/source/texk/web2c/mfluadir/otfcc/src/luafunc.c b/Build/source/texk/web2c/mfluadir/otfcc/src/luafunc.c
index 1ed14048438..bbf8e1b1b09 100644
--- a/Build/source/texk/web2c/mfluadir/otfcc/src/luafunc.c
+++ b/Build/source/texk/web2c/mfluadir/otfcc/src/luafunc.c
@@ -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 @@ extern int optind;
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 @@ static void build_readEntireFile(char *inPath, char **_buffer, long *_length) {
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,14 +294,14 @@ int otfcc_build(int b_argc, char *b_argv[]) {
build_readEntireStdin(&buffer, &length);
}*/
}
- logStepTime;
+ //logStepTime;
}
json_value *jsonRoot = NULL;
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 @@ int otfcc_build(int b_argc, char *b_argv[]) {
}
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 @@ int otfcc_build(int b_argc, char *b_argv[]) {
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 @@ int otfcc_dump(int b_argc, char *b_argv[]) {
} 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 @@ int otfcc_dump(int b_argc, char *b_argv[]) {
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 @@ int otfcc_dump(int b_argc, char *b_argv[]) {
inPath, (sfnt->count - 1));
exit(EXIT_FAILURE);
}
- logStepTime;
+ //logStepTime;
}
otfcc_Font *font;
@@ -504,11 +505,11 @@ int otfcc_dump(int b_argc, char *b_argv[]) {
}
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 @@ int otfcc_dump(int b_argc, char *b_argv[]) {
logError("Font structure broken or corrupted \"%s\". Exit.\n", inPath);
exit(EXIT_FAILURE);
}
- logStepTime;
+ //logStepTime;
dumper->free(dumper);
}
@@ -529,14 +530,20 @@ int otfcc_dump(int b_argc, char *b_argv[]) {
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 @@ int otfcc_dump(int b_argc, char *b_argv[]) {
fputs(buf, stdout);
}
#else
+ (void)(no_bom);
if (add_bom) {
fputc(0xEF, stdout);
fputc(0xBB, stdout);
@@ -589,7 +597,7 @@ int otfcc_dump(int b_argc, char *b_argv[]) {
fputs(buf, stdout);
#endif
}
- logStepTime;
+ //logStepTime;
}
loggedStep("Finalize") {
@@ -598,7 +606,7 @@ int otfcc_dump(int b_argc, char *b_argv[]) {
if (root) json_builder_free(root);
if (inPath) sdsfree(inPath);
if (outputPath) sdsfree(outputPath);
- logStepTime;
+ //logStepTime;
}
otfcc_deleteOptions(options);