Browse Source

Enable and fix -Wmissing-prototypes warnings.

master
Reece H. Dunn 7 years ago
parent
commit
05d9a4839c
3 changed files with 13 additions and 12 deletions
  1. 1
    0
      configure.ac
  2. 6
    6
      tests/printcdata.c
  3. 6
    6
      tests/printucddata.c

+ 1
- 0
configure.ac View File

dnl Reference: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html dnl Reference: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
dnl ================================================================ dnl ================================================================


AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes], [CFLAGS="-Wmissing-prototypes $CFLAGS"])
AX_CHECK_COMPILE_FLAG([-Wreturn-type], [CFLAGS="-Wreturn-type $CFLAGS"]) AX_CHECK_COMPILE_FLAG([-Wreturn-type], [CFLAGS="-Wreturn-type $CFLAGS"])


dnl ================================================================ dnl ================================================================

+ 6
- 6
tests/printcdata.c View File

} }
#endif #endif


void fput_utf8c(FILE *out, codepoint_t c)
static void fput_utf8c(FILE *out, codepoint_t c)
{ {
if (c < 0x80) if (c < 0x80)
fputc((uint8_t)c, out); fputc((uint8_t)c, out);
} }
} }


int fget_utf8c(FILE *in, codepoint_t *c)
static int fget_utf8c(FILE *in, codepoint_t *c)
{ {
int ch = EOF; int ch = EOF;
if ((ch = fgetc(in)) == EOF) return 0; if ((ch = fgetc(in)) == EOF) return 0;
return 1; return 1;
} }


void uprintf_codepoint(FILE *out, codepoint_t c, char mode)
static void uprintf_codepoint(FILE *out, codepoint_t c, char mode)
{ {
switch (mode) switch (mode)
{ {
} }
} }


void uprintf_is(FILE *out, codepoint_t c, char mode)
static void uprintf_is(FILE *out, codepoint_t c, char mode)
{ {
switch (mode) switch (mode)
{ {
} }
} }


void uprintf(FILE *out, codepoint_t c, const char *format)
static void uprintf(FILE *out, codepoint_t c, const char *format)
{ {
while (*format) switch (*format) while (*format) switch (*format)
{ {
} }
} }


void print_file(FILE *in, const char *format)
static void print_file(FILE *in, const char *format)
{ {
codepoint_t c = 0; codepoint_t c = 0;
while (fget_utf8c(in, &c)) while (fget_utf8c(in, &c))

+ 6
- 6
tests/printucddata.c View File

#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>


void fput_utf8c(FILE *out, codepoint_t c)
static void fput_utf8c(FILE *out, codepoint_t c)
{ {
if (c < 0x80) if (c < 0x80)
fputc((uint8_t)c, out); fputc((uint8_t)c, out);
} }
} }


int fget_utf8c(FILE *in, codepoint_t *c)
static int fget_utf8c(FILE *in, codepoint_t *c)
{ {
int ch = EOF; int ch = EOF;
if ((ch = fgetc(in)) == EOF) return 0; if ((ch = fgetc(in)) == EOF) return 0;
return 1; return 1;
} }


void uprintf_codepoint(FILE *out, codepoint_t c, char mode)
static void uprintf_codepoint(FILE *out, codepoint_t c, char mode)
{ {
switch (mode) switch (mode)
{ {
} }
} }


void uprintf_is(FILE *out, codepoint_t c, char mode)
static void uprintf_is(FILE *out, codepoint_t c, char mode)
{ {
switch (mode) switch (mode)
{ {
} }
} }


void uprintf(FILE *out, codepoint_t c, const char *format)
static void uprintf(FILE *out, codepoint_t c, const char *format)
{ {
while (*format) switch (*format) while (*format) switch (*format)
{ {
} }
} }


void print_file(FILE *in, const char *format)
static void print_file(FILE *in, const char *format)
{ {
codepoint_t c = 0; codepoint_t c = 0;
while (fget_utf8c(in, &c)) while (fget_utf8c(in, &c))

Loading…
Cancel
Save