Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libjpeg: add missing stdlib includes in the public header #23428

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions recipes/libjpeg/all/test_package/test_package.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
* JPEG markers.
*/

#define JPEG_CJPEG_DJPEG /* to get the command-line config symbols */
#include <jpeglib.h> /* get auto-config symbols, <stdio.h> */

#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>

#define JPEG_CJPEG_DJPEG /* to get the command-line config symbols */
#include "jpeglib.h" /* get auto-config symbols, <stdio.h> */

#ifdef HAVE_LOCALE_H
#include <locale.h> /* Bill Allombert: use locale for isprint */
#endif
Expand Down Expand Up @@ -475,41 +475,41 @@ int main(int argc, char **argv) {
if (arg[0] != '-')
break; /* not switch, must be file name */
arg++; /* advance over '-' */
if (keymatch(arg, "verbose", 1))
if (keymatch(arg, "verbose", 1))
{
verbose++;
}
else if (keymatch(arg, "raw", 1))
{
raw = 1;
}
}
else
usage();
}

/* Open the input file. */
/* Unix style: expect zero or one file name */
if (argn < argc - 1)
if (argn < argc - 1)
{
fprintf(stderr, "%s: only one input file\n", progname);
usage();
}
if (argn < argc)
if (argn < argc)
{
if ((infile = fopen(argv[argn], READ_BINARY)) == NULL)
if ((infile = fopen(argv[argn], READ_BINARY)) == NULL)
{
fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
exit(EXIT_FAILURE);
}
}
else if ((infile = fopen("testimg.jpg", READ_BINARY)) == NULL)
}
else if ((infile = fopen("testimg.jpg", READ_BINARY)) == NULL)
{
/* default input file is stdin */
#ifdef USE_SETMODE /* need to hack file mode? */
setmode(fileno(stdin), O_BINARY);
#endif
#ifdef USE_FDOPEN /* need to re-open in binary mode? */
if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL)
if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL)
{
fprintf(stderr, "%s: can't open stdin\n", progname);
exit(EXIT_FAILURE);
Expand Down
8 changes: 4 additions & 4 deletions recipes/libjpeg/all/test_package/test_transupp.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include <jpeglib.h>
#include <jpegint.h>
#include <transupp.h>

#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>

#include "jpeglib.h"
#include "jpegint.h"
#include "transupp.h"

struct error_data {
struct jpeg_error_mgr pub;
const char *name;
Expand Down
Loading