diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-06-28 23:07:55 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-06-28 23:07:55 +0000 |
commit | 11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32 (patch) | |
tree | 7c40f096dd973943ef563ec87b2a68d8205db4fb /converter/other/pamtosvg | |
parent | 89c6ec14eb7514630aea5abc4b90b51d1473d33a (diff) | |
download | netpbm-mirror-11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32.tar.gz netpbm-mirror-11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32.tar.xz netpbm-mirror-11fd0bc3fdbe7b5eb9266a728a81d0bcac91fe32.zip |
Promote Stable to Super_stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@3640 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/pamtosvg')
-rw-r--r-- | converter/other/pamtosvg/Makefile | 32 | ||||
-rw-r--r-- | converter/other/pamtosvg/bitmap.c | 4 | ||||
-rw-r--r-- | converter/other/pamtosvg/bitmap.h | 2 | ||||
-rw-r--r-- | converter/other/pamtosvg/image-proc.c | 4 | ||||
-rw-r--r-- | converter/other/pamtosvg/message.h | 16 | ||||
-rw-r--r-- | converter/other/pamtosvg/pamtosvg.c | 14 | ||||
-rw-r--r-- | converter/other/pamtosvg/pxl-outline.c | 1 | ||||
-rw-r--r-- | converter/other/pamtosvg/thin-image.c | 6 | ||||
-rw-r--r-- | converter/other/pamtosvg/vector.c | 1 |
9 files changed, 24 insertions, 56 deletions
diff --git a/converter/other/pamtosvg/Makefile b/converter/other/pamtosvg/Makefile index 8b033020..83f150d0 100644 --- a/converter/other/pamtosvg/Makefile +++ b/converter/other/pamtosvg/Makefile @@ -7,26 +7,13 @@ VPATH=.:$(SRCDIR)/$(SUBDIR) include $(BUILDDIR)/config.mk -BINARIES = pamtosvg +PORTBINARIES = pamtosvg -PAMTOSVG_OBJECTS = \ - pamtosvg.o \ - output-svg.o \ - fit.o \ - spline.o \ - curve.o \ - vector.o \ - epsilon-equal.o \ - autotrace.o \ - pxl-outline.o \ - bitmap.o \ - thin-image.o \ - logreport.o \ - exception.o \ - image-proc.o \ +BINARIES = $(PORTBINARIES) + +MERGEBINARIES = $(BINARIES) -MERGE_OBJECTS = \ - pamtosvg.o2 \ +ADDL_OBJECTS = \ output-svg.o \ fit.o \ spline.o \ @@ -41,15 +28,12 @@ MERGE_OBJECTS = \ exception.o \ image-proc.o \ -OBJECTS = $(PAMTOSVG_OBJECTS) +OBJECTS = pamtosvg.o $(ADDL_OBJECTS) -MERGEBINARIES = $(BINARIES) +MERGE_OBJECTS = pamtosvg.o2 $(ADDL_OBJECTS) all: $(BINARIES) include $(SRCDIR)/common.mk -pamtosvg: $(PAMTOSVG_OBJECTS) $(NETPBMLIB) $(LIBOPT) - $(LD) -o $@ $(PAMTOSVG_OBJECTS) \ - $(shell $(LIBOPT) $(NETPBMLIB)) \ - $(MATHLIB) $(LDFLAGS) $(LDLIBS) $(RPATH) $(LADD) +pamtosvg: $(ADDL_OBJECTS) diff --git a/converter/other/pamtosvg/bitmap.c b/converter/other/pamtosvg/bitmap.c index 1a00e748..84a8a8ae 100644 --- a/converter/other/pamtosvg/bitmap.c +++ b/converter/other/pamtosvg/bitmap.c @@ -59,8 +59,8 @@ at_bitmap_init(unsigned char * area, if (bitmap.bitmap == NULL) pm_error("Unable to allocate %u x %u x %u bitmap array", width, height, planes); - bzero(bitmap.bitmap, - width * height * planes * sizeof(unsigned char)); + memset(bitmap.bitmap, + 0, width * height * planes * sizeof(unsigned char)); } } diff --git a/converter/other/pamtosvg/bitmap.h b/converter/other/pamtosvg/bitmap.h index 7334f138..b979e0c0 100644 --- a/converter/other/pamtosvg/bitmap.h +++ b/converter/other/pamtosvg/bitmap.h @@ -36,7 +36,7 @@ at_bitmap_type * at_bitmap_new(unsigned short width, unsigned int planes); at_bitmap_type * at_bitmap_copy(at_bitmap_type * src); -/* We have to export functions that supports internal datum +/* We have to export functions that allows internal datum access. Such functions might be useful for at_bitmap_new user. */ unsigned short at_bitmap_get_width (at_bitmap_type * bitmap); diff --git a/converter/other/pamtosvg/image-proc.c b/converter/other/pamtosvg/image-proc.c index 287e6384..d025ee1e 100644 --- a/converter/other/pamtosvg/image-proc.c +++ b/converter/other/pamtosvg/image-proc.c @@ -52,7 +52,7 @@ new_distance_map(bitmap_type bitmap, unsigned char target_value, bool padded, at MALLOCARRAY(dist.d[y], w); if (dist.d[y] == NULL) pm_error("Unable to get memory for distance map"); - bzero(dist.d[y], w * sizeof(float)); + memset(dist.d[y], 0, w * sizeof(float)); MALLOCARRAY(dist.weight[y], w); if (dist.weight[y] == NULL) @@ -330,7 +330,7 @@ binarize(bitmap_type *bitmap) } else { - WARNING1("binarize: %u-plane images are not supported", spp); + WARNING1("binarize: don't know how to interpret %u-plane images", spp); } } diff --git a/converter/other/pamtosvg/message.h b/converter/other/pamtosvg/message.h index 0a226206..0d0b9db5 100644 --- a/converter/other/pamtosvg/message.h +++ b/converter/other/pamtosvg/message.h @@ -10,10 +10,6 @@ /* Define common sorts of messages. */ -/* This should be called only after a system call fails. */ -#define FATAL_PERROR(s) do { perror (s); exit (errno); } while (0) - - #define START_FATAL() do { fputs ("fatal: ", stderr); LOG("fatal: ") #define END_FATAL() fputs (".\n", stderr); exit (1); } while (0) @@ -21,12 +17,6 @@ START_FATAL (); fprintf (stderr, "%s", s); LOG (s); END_FATAL () #define FATAL1(s, e1) \ START_FATAL (); fprintf (stderr, s, e1); LOG1 (s, e1); END_FATAL () -#define FATAL2(s, e1, e2) \ - START_FATAL (); fprintf (stderr, s, e1, e2); LOG2 (s, e1, e2); END_FATAL () -#define FATAL3(s, e1, e2, e3) \ - START_FATAL (); fprintf (stderr, s, e1, e2, e3); LOG3 (s, e1, e2, e3); END_FATAL () -#define FATAL4(s, e1, e2, e3, e4) \ - START_FATAL (); fprintf (stderr, s, e1, e2, e3, e4); LOG4 (s, e1, e2, e3, e4); END_FATAL () #define START_WARNING() do { fputs ("warning: ", stderr); LOG ("warning: ") @@ -36,12 +26,6 @@ START_WARNING (); fprintf (stderr, "%s", s); LOG (s); END_WARNING () #define WARNING1(s, e1) \ START_WARNING (); fprintf (stderr, s, e1); LOG1 (s, e1); END_WARNING () -#define WARNING2(s, e1, e2) \ - START_WARNING (); fprintf (stderr, s, e1, e2); LOG2 (s, e1, e2); END_WARNING () -#define WARNING3(s, e1, e2, e3) \ - START_WARNING (); fprintf (stderr, s, e1, e2, e3); LOG3 (s, e1, e2, e3); END_WARNING () -#define WARNING4(s, e1, e2, e3, e4) \ - START_WARNING (); fprintf (stderr, s, e1, e2, e3, e4); LOG4 (s, e1, e2, e3, e4); END_WARNING () #endif /* not MESSAGE_H */ diff --git a/converter/other/pamtosvg/pamtosvg.c b/converter/other/pamtosvg/pamtosvg.c index dbe67c74..adf76801 100644 --- a/converter/other/pamtosvg/pamtosvg.c +++ b/converter/other/pamtosvg/pamtosvg.c @@ -134,8 +134,8 @@ parseCommandLine(int argc, Note that the strings we return are stored in the storage that was passed to us as the argv array. We also trash *argv. --------------------------------------------------------------------------*/ - optEntry *option_def; - /* Instructions to optParseOptions3 on how to parse our options. */ + optEntry * option_def; + /* Instructions to pm_optParseOptions3 on how to parse our options. */ optStruct3 opt; const char * background_colorOpt; @@ -197,7 +197,7 @@ parseCommandLine(int argc, cmdlineP->tangent_surround = 3; cmdlineP->width_weight_factor = 6.0; - optParseOptions3( &argc, argv, opt, sizeof(opt), 0 ); + pm_optParseOptions3( &argc, argv, opt, sizeof(opt), 0 ); /* Uses and sets argc, argv, and some of *cmdlineP and others. */ if (cmdlineP->backgroundSpec) @@ -334,7 +334,7 @@ openLogFile(FILE ** const logFileP, const char * logfileName; if (streq(inputFileArg, "-")) - asprintfN(&logfileName, "pamtosvg.log"); + pm_asprintf(&logfileName, "pamtosvg.log"); else { const char * inputRootName; @@ -343,14 +343,14 @@ openLogFile(FILE ** const logFileP, pm_error("Can't find the root portion of file name '%s'", inputFileArg); - asprintfN(&logfileName, "%s.log", inputRootName); + pm_asprintf(&logfileName, "%s.log", inputRootName); - strfree(inputRootName); + pm_strfree(inputRootName); } *logFileP = pm_openw(logfileName); - strfree(logfileName); + pm_strfree(logfileName); } diff --git a/converter/other/pamtosvg/pxl-outline.c b/converter/other/pamtosvg/pxl-outline.c index a1fa5299..456f41e1 100644 --- a/converter/other/pamtosvg/pxl-outline.c +++ b/converter/other/pamtosvg/pxl-outline.c @@ -9,7 +9,6 @@ #include "message.h" #include "bitmap.h" -#include "bitmap.h" #include "logreport.h" #include "pxl-outline.h" diff --git a/converter/other/pamtosvg/thin-image.c b/converter/other/pamtosvg/thin-image.c index 40ced794..364f67cc 100644 --- a/converter/other/pamtosvg/thin-image.c +++ b/converter/other/pamtosvg/thin-image.c @@ -171,7 +171,7 @@ thin_image(bitmap_type *image, bool bgSpec, pixel bg, if (PPM_ISGRAY(background)) bg_color = PPM_GETR(background); else - bg_color = PPM_LUMIN(background); + bg_color = ppm_luminosity(background); for (n = num_pixels - 1; n >= 0L; --n) { @@ -189,7 +189,7 @@ thin_image(bitmap_type *image, bool bgSpec, pixel bg, default: { - LOG1 ("thin_image: %u-plane images are not supported", spp); + LOG1 ("thin_image: Don't know how to interpret %u-plane images", spp); at_exception_fatal(exp, "thin_image: wrong plane images are passed"); goto cleanup; } @@ -306,7 +306,7 @@ void thin1(bitmap_type *image, unsigned char colour) if (PPM_ISGRAY(background)) bg_color = PPM_GETR(background); else - bg_color = PPM_LUMIN(background); + bg_color = ppm_luminosity(background); LOG (" Thinning image.....\n "); xsize = image->width; diff --git a/converter/other/pamtosvg/vector.c b/converter/other/pamtosvg/vector.c index 7678f73a..0a5ef3a9 100644 --- a/converter/other/pamtosvg/vector.c +++ b/converter/other/pamtosvg/vector.c @@ -1,5 +1,6 @@ /* vector.c: vector/point operations. */ +#define _XOPEN_SOURCE /* Make sure M_PI is in <math.h> */ #include <math.h> #include <errno.h> #include <assert.h> |