Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[xsrc/trunk]: xsrc/external/mit merge bitmap 1.0.9 and mkfontscale 1.2.0.
details: https://anonhg.NetBSD.org/xsrc/rev/8e7cb977bfcc
branches: trunk
changeset: 10145:8e7cb977bfcc
user: mrg <mrg%NetBSD.org@localhost>
date: Sun Mar 03 09:18:36 2019 +0000
description:
merge bitmap 1.0.9 and mkfontscale 1.2.0.
diffstat:
external/mit/bitmap/dist/README | 25 -------
external/mit/mkfontscale/dist/README | 26 -------
external/mit/mkfontscale/dist/ident.c | 13 ++-
external/mit/mkfontscale/dist/mkfontscale.c | 96 +++++++++++++++-------------
4 files changed, 58 insertions(+), 102 deletions(-)
diffs (truncated from 395 to 300 lines):
diff -r bdc24e44e17f -r 8e7cb977bfcc external/mit/bitmap/dist/README
--- a/external/mit/bitmap/dist/README Sun Mar 03 09:16:10 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-bitmap, bmtoa, atobm - X bitmap (XBM) editor and converter utilities
-
-All questions regarding this software should be directed at the
-Xorg mailing list:
-
- http://lists.freedesktop.org/mailman/listinfo/xorg
-
-Please submit bug reports to the Xorg bugzilla:
-
- https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
-
-The master development code repository can be found at:
-
- git://anongit.freedesktop.org/git/xorg/app/bitmap
-
- http://cgit.freedesktop.org/xorg/app/bitmap
-
-For patch submission instructions, see:
-
- http://www.x.org/wiki/Development/Documentation/SubmittingPatches
-
-For more information on the git code manager, see:
-
- http://wiki.x.org/wiki/GitPage
-
diff -r bdc24e44e17f -r 8e7cb977bfcc external/mit/mkfontscale/dist/README
--- a/external/mit/mkfontscale/dist/README Sun Mar 03 09:16:10 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-mkfontscale creates the fonts.scale and fonts.dir index files used by the
-legacy X11 font system.
-
-All questions regarding this software should be directed at the
-Xorg mailing list:
-
- http://lists.freedesktop.org/mailman/listinfo/xorg
-
-Please submit bug reports to the Xorg bugzilla:
-
- https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
-
-The master development code repository can be found at:
-
- git://anongit.freedesktop.org/git/xorg/app/mkfontscale
-
- http://cgit.freedesktop.org/xorg/app/mkfontscale
-
-For patch submission instructions, see:
-
- http://www.x.org/wiki/Development/Documentation/SubmittingPatches
-
-For more information on the git code manager, see:
-
- http://wiki.x.org/wiki/GitPage
-
diff -r bdc24e44e17f -r 8e7cb977bfcc external/mit/mkfontscale/dist/ident.c
--- a/external/mit/mkfontscale/dist/ident.c Sun Mar 03 09:16:10 2019 +0000
+++ b/external/mit/mkfontscale/dist/ident.c Sun Mar 03 09:18:36 2019 +0000
@@ -76,12 +76,12 @@
gzFile gz;
BZFILE *bz2;
} f;
- unsigned pos;
+ unsigned long pos;
} fontFile;
static inline void *
fontFileOpen(fontFile *ff, const char *filename) {
- int n = strlen(filename);
+ size_t n = strlen(filename);
if (n > 4 && strcmp(filename + n - 4, ".bz2") == 0) {
ff->type = bz2FontFile;
@@ -123,7 +123,7 @@
}
}
-static int
+static long
fontFileSeek(fontFile *ff, z_off_t offset, int whence)
{
if (ff->type == gzFontFile) {
@@ -132,7 +132,7 @@
/* bzlib has no easy equivalent so we have to fake it,
* fortunately, we only have to handle a couple of cases
*/
- int n;
+ z_off_t n;
char buf[BUFSIZ];
switch (whence) {
@@ -151,7 +151,7 @@
return -1;
n -= BUFSIZ;
}
- if (BZ2_bzread(ff->f.bz2, buf, n) != n)
+ if (BZ2_bzread(ff->f.bz2, buf, (int) n) != n)
return -1;
ff->pos = offset;
return offset;
@@ -247,7 +247,8 @@
{
int prop_position;
PropPtr props = NULL;
- int format, count, nprops, i, string_size, rc;
+ int format, count, nprops, i, string_size;
+ long rc;
char *strings = NULL, *s;
count = getLSB32(f);
diff -r bdc24e44e17f -r 8e7cb977bfcc external/mit/mkfontscale/dist/mkfontscale.c
--- a/external/mit/mkfontscale/dist/mkfontscale.c Sun Mar 03 09:16:10 2019 +0000
+++ b/external/mit/mkfontscale/dist/mkfontscale.c Sun Mar 03 09:18:36 2019 +0000
@@ -48,6 +48,7 @@
#include FT_XFREE86_H
#include "list.h"
+#include "constlist.h"
#include "hash.h"
#include "data.h"
#include "ident.h"
@@ -88,14 +89,14 @@
static char *extra_encodings_array[] =
{ "iso10646-1", "adobe-fontspecific", "microsoft-symbol" };
-static ListPtr encodings, extra_encodings;
+static ConstListPtr encodings, extra_encodings;
static const char *outfilename;
#define countof(_a) (sizeof(_a)/sizeof((_a)[0]))
static int doDirectory(const char*, int, ListPtr);
-static int checkEncoding(FT_Face face, char *encoding_name);
-static int checkExtraEncoding(FT_Face face, char *encoding_name, int found);
+static int checkEncoding(FT_Face face, const char *encoding_name);
+static int checkExtraEncoding(FT_Face face, const char *encoding_name, int found);
static int find_cmap(int type, int pid, int eid, FT_Face face);
static const char* notice_foundry(const char *notice);
static const char* vendor_foundry(const signed char *vendor);
@@ -152,16 +153,17 @@
exit(1);
}
if(prefix[strlen(prefix) - 1] != '/')
- strcat(prefix, "/");
- encodingPrefix = dsprintf("%s", prefix);
+ encodingPrefix = dsprintf("%s/", prefix);
+ else
+ encodingPrefix = strdup(prefix);
outfilename = NULL;
- encodings = makeList(encodings_array, countof(encodings_array), NULL, 0);
+ encodings = makeConstList(encodings_array, countof(encodings_array), NULL, 0);
- extra_encodings = makeList(extra_encodings_array,
- countof(extra_encodings_array),
- NULL, 0);
+ extra_encodings = makeConstList(extra_encodings_array,
+ countof(extra_encodings_array),
+ NULL, 0);
doBitmaps = 0;
doISO10646_1_encoding = 1;
doScalable = 1;
@@ -187,7 +189,7 @@
if(argn >= argc - 1) {
missing_arg("-a");
}
- makeList(&argv[argn + 1], 1, encodings, 0);
+ makeConstList((const char **)&argv[argn + 1], 1, encodings, 0);
argn += 2;
} else if(strcmp(argv[argn], "-p") == 0) {
if(argn >= argc - 1) {
@@ -199,7 +201,7 @@
usage();
}
free(encodingPrefix);
- encodingPrefix = dsprintf("%s", argv[argn + 1]);
+ encodingPrefix = strdup(argv[argn + 1]);
argn += 2;
} else if(strcmp(argv[argn], "-e") == 0) {
if(argn >= argc - 1) {
@@ -320,7 +322,7 @@
{
FT_SfntName name;
char *string;
- int i;
+ unsigned int i;
if(getNameHelper(face, nid,
TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS, &name) ||
@@ -414,8 +416,8 @@
nameWidth(const char *name)
{
char buf[500];
- int i;
- int n = strlen(name);
+ unsigned int i;
+ size_t n = strlen(name);
if(n >= 499) return NULL;
for(i = 0; i < n; i++)
@@ -699,7 +701,7 @@
static int
readFontScale(HashTablePtr entries, char *dirname)
{
- int n = strlen(dirname);
+ size_t n = strlen(dirname);
char *filename;
FILE *in;
int rc, count, i;
@@ -743,7 +745,7 @@
static int
filePrio(char *filename)
{
- int n = strlen(filename);
+ size_t n = strlen(filename);
if(n < 4)
return 0;
if(strcmp(filename + n - 4, ".otf") == 0)
@@ -778,26 +780,27 @@
{
char *dirname, *fontscale_name, *filename, *encdir;
FILE *fontscale, *encfile;
- DIR *dirp;
- struct dirent *entry;
+ struct dirent** namelist;
FT_Error ftrc;
FT_Face face;
- ListPtr encoding, xlfd, lp;
+ ConstListPtr encoding;
+ ListPtr xlfd, lp;
HashTablePtr entries;
HashBucketPtr *array;
- int i, n, found, rc;
- int isBitmap=0,xl=0;
+ int i, n, dirn, diri, found, rc;
+ int isBitmap=0;
+ size_t d, xl=0;
if (exclusionSuffix)
xl = strlen (exclusionSuffix);
- i = strlen(dirname_given);
- if(i == 0)
+ d = strlen(dirname_given);
+ if(d == 0)
dirname = dsprintf("./");
- else if(dirname_given[i - 1] != '/')
+ else if(dirname_given[d - 1] != '/')
dirname = dsprintf("%s/", dirname_given);
else
- dirname = dsprintf("%s", dirname_given);
+ dirname = strdup(dirname_given);
if(dirname == NULL) {
perror("dirname");
@@ -816,7 +819,7 @@
fontscale_name = NULL;
else {
if(outfilename[0] == '/')
- fontscale_name = dsprintf("%s", outfilename);
+ fontscale_name = strdup(outfilename);
else
fontscale_name = dsprintf("%s%s", dirname, outfilename);
if(fontscale_name == NULL) {
@@ -825,10 +828,10 @@
}
}
- dirp = opendir(dirname);
- if(dirp == NULL) {
+ dirn = scandir(dirname, &namelist, NULL, alphasort);
+ if(dirn < 0) {
fprintf(stderr, "%s: ", dirname);
- perror("opendir");
+ perror("scandir");
return 0;
}
@@ -843,7 +846,8 @@
return 0;
}
- while((entry = readdir(dirp)) != NULL) {
+ for(diri = dirn - 1; diri >= 0; diri--) {
+ struct dirent *entry = namelist[diri];
int have_face = 0;
char *xlfd_name = NULL;
struct stat f_stat;
@@ -852,7 +856,7 @@
xlfd = NULL;
if (xl) {
- int dl = strlen (entry->d_name);
+ size_t dl = strlen (entry->d_name);
if (strcmp (entry->d_name + dl - xl, exclusionSuffix) == 0)
Home |
Main Index |
Thread Index |
Old Index