summaryrefslogtreecommitdiff
path: root/contrib/japanese
Commit message (Collapse)AuthorAgeFilesLines
* Epson ESC device - add fuzzy matching for media sizesKen Sharp2023-02-171-2/+4
| | | | | | | | | | | | | | Bug #706367 "ESC/Page driver does not set page size correctly" The PLRM indicates (Table 6.2, page 401, PageSize) that page dimensions are considered to match if they are within a tolerance of 5 units in each direction. This device (like others) was insisting on a precise match. Just add the tolerance. I have no way to test this, other than looking at the content of the output from the device, written to file, which appears to be correct.
* Coverity 375625: Avoid using uninit variable paper_command.Robin Watts2022-02-171-0/+1
| | | | | Pick a default paper size so Coverity can see that we never reach the use of paper_command without having set it.
* Move contrib from gs_sprintf to gs_snprintf.Robin Watts2022-02-165-21/+21
|
* Move more devices towards encode/decode_color.Robin Watts2021-07-011-3/+0
|
* Split initialize device proc into two.Robin Watts2021-04-2612-143/+76
| | | | | | | | | | | | | | | | | The device initialize function currently performs 2 jobs. Firstly, it fills out the device_procs. Secondly, it performs any minimal initialization required by the device (typically none). At various points in the code we want to be able to copy procs from one 'prototype' device to another, so we call initialize for that. This populates the device procs, but does other work that typically requires a 'derived device' structure rather than a vanilla gx_device to work in. Accordingly, we split the job into two; initialize_device_procs (the first part) and initialize_device (the second part). The initialize_device_procs function will set up the initialize_device function pointer along with the rest if required.
* Further rationalisation of device init.Robin Watts2021-04-2012-107/+64
| | | | | | | | | | Move the initialize procedure out of the device procs table, and into a bare function pointer at the start of the device proc. Devices just initialise this, and the rest should fall into place. This means changes to the device instantion macros (and all the uses thereof), but makes the code nicer overall. In particular, this removes the vestigial 'static_procs' structure.
* Move devices away from static init of procs.Robin Watts2021-04-208-73/+201
|
* Rename finish_copydevice to initialize, and remove second param.Robin Watts2021-04-201-1/+1
| | | | | | | | | | | It used to be that finish_copydevice(dev, const old_dev) would be used to copy stuff from a prototype to a new instance of a device. Now, no copying is ever done. Also, it's a confusing name. Rename it to be 'initialize', which is clearer. Also, it should become even more appropriate in future, if we have this function be the one that is responsible for filling out the procs.
* Solve indeterminism in pr1000_4 device.Robin Watts2021-04-151-2/+16
| | | | | | | | | | | | | | | | | | | There are 4 devices (pr201, pr1000, pr150, and pr1000_4) that are all basically the same code. They differ in the number of lines of data they deal with at once. The first 3 use 24, 40 and 48 lines respectively - all numbers that are multiples of 8. The code reads that many lines at once and then "transposes" the data to send 'columns' of 24/40/48 pixels at once. The pr1000_4 variant uses 60 lines. This means we read outside the input buffer into uninitialised data. I have my doubts that this device actually works properly, but the change here simply bumps up the buffer sizes to be larger and initialises it all to 0 so we get consistent SHAs in cluster testing.
* Remove the dmprt deviceChris Liddell2020-07-076-4488/+0
| | | | | | | | | It has code which triggers security warnings, it has not built as it stands since before 8.71 (so >10 years) and has significant (segfaulting) problems when modified to successfully build. Since it cannot have been used (and no one has complained) in over ten years, we're removing it.
* Coverity 95087: use cast to indicate intermediate integer division is expected.Julian Smith2020-01-091-1/+1
|
* Coverity 95077: fixed various scan-build issues with contrib/japanese/gdevmjc.c.Julian Smith2019-11-281-11/+2
| | | | Some of these will correspond to coverity issues also.
* Coverity 95077: removed unused assignment to <H> variable.Julian Smith2019-11-281-2/+0
|
* Fix indeterminism in gdevp201.cRobin Watts2019-11-251-7/+25
| | | | | | | | | | | The printers herein read 1bpp data from gs, and then compressed in terms of bytes. For the case where w%8 != 0, we'd have uninitialised bits. Solve this by masking the last byte of each line as appropriate. Also, ensure that we don't 'overread' lines, check the return code from the get_bits call, and blank any lines of the buffer required to bring us up to a multiple of the stripe height.
* Coverity 350172: fix gp_fprintf() call to use PRIdSIZE for ptrdiff_t.Julian Smith2019-11-221-1/+1
|
* Squash a float -> int warning.Robin Watts2019-11-151-2/+2
|
* Bug 701854: bj10v_print_page(): increase buffer by one byte to give space ↵Julian Smith2019-11-081-1/+2
| | | | | | | for sentinel. Fixes: ./sanbin/gs -r928 -sOutputFile=tmp -sDEVICE=bj10v ../bug-701854.ps
* Fix various incorrect casts in contrib devices.Robin Watts2019-10-311-3/+3
| | | | | | | Various contrib devices cast a gx_color_index (a 32 or 64 bit value typically containing 24 bits of data) down to a gx_color_value before manipulating it. This is a typo, copied into several places in the code. Correct it here.
* Fix warnings when building contrib on windows.Robin Watts2019-10-316-64/+64
| | | | | | MSVC is much more sensitive to casting types than gcc is, it seems. Accordingly avoid making doubles when we want floats, and make all casts down to int (or byte) explicit.
* Avoid some devices dying due to inappropriate resolutions.Robin Watts2019-10-292-8/+15
|
* Avoid division by zero with bj10v device.Robin Watts2019-10-291-1/+14
| | | | | When called with a low resolution, we can end up dividing by zero. Spot this in the open call and give a rangecheck error.
* Bug 701799: avoid out-of-range array access in mj_color_correct().Julian Smith2019-10-291-1/+4
| | | | | | | | Code is obscure, so this fix merely avoids out-of-range access in the simplest way possible, without understanding what the code is trying to do. Fixes: ./sanbin/gs -sOutputFile=tmp -sDEVICE=mj6000c ../bug-701799.pdf
* Bug 701793: check we are within buffer before comparing buffer contents.Julian Smith2019-10-291-1/+1
| | | | | Fixes: ./sanbin/gs -sOutputFile=tmp -sDEVICE=mj700v2c ../bug-701793.pdf
* "Fix" contrib and test uses of gp_fopen.Robin Watts2019-06-193-42/+46
| | | | | | | | | | | | | | Here we fix a lot of contrib devices that had been broken by the changes to gp_file. I believe they all should work OK now. One of the routines was calling lib_fopen in an unsupported way; this can't easily be fixed, so we just call gp_fopen instead now. We also "fix" some test code that was calling gp_fopen and then doing things that we can't easily do with a gp_file *. This code has reverted to using FILE *'s and fopen - this might cause issues on compilation as this code is untested, but it's better than compiling to give code that crashes.
* Move FILE * operations behind new gp_file * API.Robin Watts2019-05-2914-363/+362
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (squash of commits from filesec branch) Most of this commit is donkeywork conversions of calls from FILE * -> gp_file *, fwrite -> gp_fwrite etc. Pretty much every device is touched, along with the clist and parsing code. The more interesting changes are within gp.h (where the actual new API is defined), gpmisc.c (where the basic implementations live), and the platform specific levels (gp_mswin.c, gp_unifs.c etc where the platform specific implementations have been tweaked/renamed). File opening path validation All file opening routines now call a central routine for path validation. This then consults new entries in gs_lib_ctx to see if validation is enabled or not. If so, it validates the paths by seeing if they match. Simple C level functions for adding/removing/clearing paths, exposed through the gsapi level. Add 2 postscript operators for path control. <name> <string> .addcontrolpath - Add the given <string> (path) to the list of paths for controlset <name>, where <name> can be: /PermitFileReading /PermitFileWriting /PermitFileControl (Anything else -> rangecheck) - .activatepathcontrol - Enable path control. At this point PS cannot make any more changes, and all file access is checked.
* Coverity CIDs: 326829, 326828 and 326827Chris Liddell2018-11-191-1/+3
| | | | Check return values for gdev_prn_open_printer()
* Contrib devices: Check for error return opening output fileChris Liddell2018-11-082-7/+10
| | | | | | | | | | | | | | 09-59.PS cycles through every available device, attempting to open each one. For many devices this results in an invalid configuration (mainly a lack of output file). These devices, on being shutdown, ignored the lack of output file, and attempted to write their final bytes out anyway (attempting to write data to a null FILE * pointer), causing a segfault. We now check the return value of gdev_prn_open_printer() and only write those final bytes if gdev_prn_open_printer() completed successfully.
* "rpdl" output device: Allow 5pt tolerance for page size selectionTill Kamppeter2016-11-161-16/+17
| | | | | | | | The "rpdl" printer driver required an exact match of the page size in points so that the correct command for selecting the page size was sent to the printer. Otherwise the printer received the command for a custom size. Tis is fixed now, allowing a 5-point tolerance (Bug 697348).
* Remove mag16 and mag256 devicesChris Liddell2016-10-101-335/+0
|
* Bug 697032 - remove files with unsuitable licensesHenry Stiles2016-08-304-1603/+0
|
* Make gs_imager_state == gs_state.Chris Liddell2016-06-062-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change how gstate initialisation is done: Previously we relied on the imager state being a subset of the gstate (thus assigning an imager state to a graphics state over wrote to the entries common to both, and didn't overwrite any already set graphics state specific entries). Making the imager and graphics states the same means that approach doesn't work, so this changes it to initialise the entries individually. Renames gsistate.c->gsgstate.c and gxistate.h->gxgstate.h Cleanup and fix the gs_state gc stuff. Uses different check for pre/post clist pdf14 device Previously, the code used "is_gstate" in the imager/graphics state object to determine if the code was being called pre or post clist (post clist would only ever have had an imager_state so is_gstate = false). With no imager state any more, that test would no longer work (and I am dubious about whether it was really safe, anyway). Other places check for the presence of a clist reader device in the pdf14 device structure - so use that here too. Adds initial (NULL) value for show_gstate pointer in gs_state. Removes the now pointless macro for the contents of the graphics state Changes function names that had "imager" to use "gstate" Removes the redundant 'is_state' flag Cleans up gs_(g)state_putdeviceparams(): Previously we had to similar routines: one took a graphics state, and used the device from the graphics state, the other took an imager state and the device as an explicit parameter. With the removal of the imager state, "merge" those two functions Replaces gs_state with gs_gstate It makes for less confusion as it really is a g(raphics)state
* Update devices to return errors using return_error.Robin Watts2016-02-181-16/+16
|
* Bug 696521. Fix for bit rotted contributed devices.Michael Vrhel2016-01-251-1/+59
| | | | | These devices now run to completion. I can't verify if the output is correct however.
* Squash warnings: Use better unused var paradigm.Robin Watts2016-01-041-1/+1
| | | | | Using "n = n;" causes some versions of gcc to whinge. Trying (void)n; instead.
* Squash warnings: Contrib devicesRobin Watts2016-01-047-14/+14
| | | | | | | Workaround as many warnings as possible in the contrib devices. Removing dead code, checking return values etc, fixing type casts (char to unsigned char etc).
* Squash warnings: Cull unused or dead code.Robin Watts2016-01-042-14/+7
| | | | | In cases where the code is there for potential future use, comment small sections out or use #ifdef UNUSED.
* Squash Warnings: Simple unused variable warnings.Robin Watts2016-01-041-1/+0
|
* Expunge references to e_* style errorsChris Liddell2015-11-021-19/+19
| | | | No cluster differences
* Commit of build_consolidation branchChris Liddell2015-07-2039-0/+18181
Squashed into one commit (see branch for details of the evolution of the branch). This brings gpcl6 and gxps into the Ghostscript build system, and a shared set of graphics library object files for all the interpreters. Also, brings the same configuration options to the pcl and xps products as we have for Ghostscript.