diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-03-26 02:53:02 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-03-26 02:53:02 +0000 |
commit | b117a415aaf58c435805243a930e833f8cf62421 (patch) | |
tree | ca6cda4c24d37737a3942e534b95006bcd566c5a /generator | |
parent | 34bb24c566c9d9fe3c4ae71fc4c6b53323fb1dd9 (diff) | |
download | netpbm-mirror-b117a415aaf58c435805243a930e833f8cf62421.tar.gz netpbm-mirror-b117a415aaf58c435805243a930e833f8cf62421.tar.xz netpbm-mirror-b117a415aaf58c435805243a930e833f8cf62421.zip |
Promote trunk (10.90.00) to advanced
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@3784 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'generator')
-rw-r--r-- | generator/pamtris/boundaries.c | 2 | ||||
-rw-r--r-- | generator/pamtris/framebuffer.c | 4 | ||||
-rw-r--r-- | generator/pbmtext.c | 4 | ||||
-rw-r--r-- | generator/pgmnoise.c | 27 | ||||
-rw-r--r-- | generator/ppmforge.c | 4 |
5 files changed, 25 insertions, 16 deletions
diff --git a/generator/pamtris/boundaries.c b/generator/pamtris/boundaries.c index 7045cbc7..cfcc4c1d 100644 --- a/generator/pamtris/boundaries.c +++ b/generator/pamtris/boundaries.c @@ -120,7 +120,7 @@ gen_triangle_boundaries(Xy const xy, } if (xy._[0][1] == xy._[1][1] && xy._[1][1] == xy._[2][1]) { - /* Triangle is degenarate: its visual representation consists only of + /* Triangle is degenerate: its visual representation consists only of a horizontal straight line. */ diff --git a/generator/pamtris/framebuffer.c b/generator/pamtris/framebuffer.c index 93263c91..5665e9a4 100644 --- a/generator/pamtris/framebuffer.c +++ b/generator/pamtris/framebuffer.c @@ -164,7 +164,7 @@ realloc_image_buffer(int32_t const new_maxval, function "process_next_command", which is the only function that calls this one. - If the function suceeds, the image buffer is left in cleared state. The + If the function succeeds, the image buffer is left in cleared state. The Z-Buffer, however, is not touched at all. If the new depth is equal to the previous one, no actual reallocation is @@ -313,7 +313,7 @@ draw_span(uint32_t const base, unsigned int l; /* The following statements will only have any effect if the depth - test, performed above, has suceeded. I. e. if the depth test fails, + test, performed above, has succeeded. I. e. if the depth test fails, no changes will be made on the frame buffer; otherwise, the frame buffer will be updated with the new values. */ diff --git a/generator/pbmtext.c b/generator/pbmtext.c index 6304c7d4..e52a296e 100644 --- a/generator/pbmtext.c +++ b/generator/pbmtext.c @@ -610,7 +610,7 @@ getCharsWithinWidth(PM_WCHAR const line[], if (currentWidth > targetWidth) { if (cursor == 1) pm_error("-width value too small " - "to accomodate single character"); + "to accommodate single character"); else *charCountP = cursor - 1; } else @@ -991,7 +991,7 @@ getText(PM_WCHAR const cmdlineText[], if (!buf) pm_error("Unable to allocate memory for up to %u characters of " "text", MAXLINECHARS); - buf[lineBufTerm] = L'\1'; /* Initalize to non-zero value */ + buf[lineBufTerm] = L'\1'; /* Initialize to non-zero value */ /* to detect input overrun */ maxlines = 50; /* initial value */ diff --git a/generator/pgmnoise.c b/generator/pgmnoise.c index 40d0e189..e3e4eca6 100644 --- a/generator/pgmnoise.c +++ b/generator/pgmnoise.c @@ -3,11 +3,12 @@ Frank Neumann, October 1993 *********************************************************************/ +#include <assert.h> #include "pm_c_util.h" #include "mallocvar.h" +#include "nstring.h" #include "shhopt.h" #include "pgm.h" -#include <assert.h> @@ -68,16 +69,24 @@ parseCommandLine(int argc, const char ** const argv, "Arguments are width and height of image, in pixels", argc-1); else { - int const width = atoi(argv[1]); - int const height = atoi(argv[2]); - - if (width <= 0) - pm_error("Width must be positive, not %d", width); + const char * error; /* error message of pm_string_to_uint */ + unsigned int width, height; + + pm_string_to_uint(argv[1], &width, &error); + if (error) + pm_error("Width argument is not an unsigned integer. %s", + error); + else if (width == 0) + pm_error("Width argument is zero; must be positive"); else cmdlineP->width = width; - if (height <= 0) - pm_error("Height must be positive, not %d", width); + pm_string_to_uint(argv[2], &height, &error); + if (error) + pm_error("Height argument is not an unsigned integer. %s ", + error); + else if (height == 0) + pm_error("Height argument is zero; must be positive"); else cmdlineP->height = height; } @@ -139,7 +148,7 @@ pgmnoise(FILE * const ofP, /* If maxval is 2^n-1, we draw exactly n bits from the pool. Otherwise call rand() and determine gray value by modulo. - In the latter case, there is a miniscule skew toward 0 (=black) + In the latter case, there is a minuscule skew toward 0 (=black) because smaller numbers are produced more frequently by modulo. Thus we employ the pool method only when it is certain that no skew will ensue. diff --git a/generator/ppmforge.c b/generator/ppmforge.c index fe80f529..8fec9fee 100644 --- a/generator/ppmforge.c +++ b/generator/ppmforge.c @@ -49,7 +49,7 @@ static double const hugeVal = 1e50; #define Real(v, x, y) v[1 + (((x) * meshsize) + (y)) * 2] #define Imag(v, x, y) v[2 + (((x) * meshsize) + (y)) * 2] -/* Co-ordinate indices within arrays. */ +/* Coordinate indices within arrays. */ typedef struct { double x; @@ -71,7 +71,7 @@ static int meshsize = 256; /* FFT mesh size */ static double inclangle, hourangle; /* Star position relative to planet */ static bool inclspec = FALSE; /* No inclination specified yet */ static bool hourspec = FALSE; /* No hour specified yet */ -static double icelevel; /* Ice cap theshold */ +static double icelevel; /* Ice cap threshold */ static double glaciers; /* Glacier level */ static int starfraction; /* Star fraction */ static int starcolor; /* Star color saturation */ |