diff options
Diffstat (limited to 'rdjpgcom.c')
-rw-r--r-- | rdjpgcom.c | 31 |
1 files changed, 7 insertions, 24 deletions
@@ -4,8 +4,8 @@ * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1997, Thomas G. Lane. * Modified 2009 by Bill Allombert, Guido Vollbeding. - * It was modified by The libjpeg-turbo Project to include only code relevant - * to libjpeg-turbo. + * libjpeg-turbo Modifications: + * Copyright (C) 2022, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -15,12 +15,14 @@ * JPEG markers. */ +#ifdef _MSC_VER +#define _CRT_SECURE_NO_DEPRECATE +#endif + #define JPEG_CJPEG_DJPEG /* to get the command-line config symbols */ #include "jinclude.h" /* get auto-config symbols, <stdio.h> */ -#ifdef HAVE_LOCALE_H #include <locale.h> /* Bill Allombert: use locale for isprint */ -#endif #include <ctype.h> /* to declare isupper(), tolower() */ #ifdef USE_SETMODE #include <fcntl.h> /* to declare setmode()'s parameter macros */ @@ -28,16 +30,6 @@ #include <io.h> /* to declare setmode() */ #endif -#ifdef USE_CCOMMAND /* command-line reader for Macintosh */ -#ifdef __MWERKS__ -#include <SIOUX.h> /* Metrowerks needs this */ -#include <console.h> /* ... and this */ -#endif -#ifdef THINK_C -#include <console.h> /* Think declares it here */ -#endif -#endif - #ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ #define READ_BINARY "r" #else @@ -223,9 +215,7 @@ process_COM(int raw) int lastch = 0; /* Bill Allombert: set locale properly for isprint */ -#ifdef HAVE_LOCALE_H setlocale(LC_CTYPE, ""); -#endif /* Get the marker parameter length count */ length = read_2_bytes(); @@ -253,7 +243,7 @@ process_COM(int raw) } else if (isprint(ch)) { putc(ch, stdout); } else { - printf("\\%03o", ch); + printf("\\%03o", (unsigned int)ch); } lastch = ch; length--; @@ -261,9 +251,7 @@ process_COM(int raw) printf("\n"); /* Bill Allombert: revert to C locale */ -#ifdef HAVE_LOCALE_H setlocale(LC_CTYPE, "C"); -#endif } @@ -452,11 +440,6 @@ main(int argc, char **argv) char *arg; int verbose = 0, raw = 0; - /* On Mac, fetch a command line. */ -#ifdef USE_CCOMMAND - argc = ccommand(&argv); -#endif - progname = argv[0]; if (progname == NULL || progname[0] == 0) progname = "rdjpgcom"; /* in case C library doesn't provide it */ |