Skip to content

Commit

Permalink
Fix wstrict-prototypes warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Oct 18, 2022
1 parent f5d8d11 commit 24815e3
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 60 deletions.
27 changes: 8 additions & 19 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
Expand All @@ -18,8 +18,6 @@ jobs:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'devel'}
- {os: windows-2022, r: 'devel-ucrt'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
Expand All @@ -31,28 +29,19 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v1

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
upload-snapshots: true
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: unrtf
Type: Package
Title: Extract Text from Rich Text Format (RTF) Documents
Version: 1.4.1
Version: 1.4.2
Authors@R: c(
person("Jeroen", "Ooms", ,"jeroen@berkeley.edu", role = c("aut", "cre")),
person("Free Software Foundation, Inc", role = "cph"))
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.4.2
- Fix strict-prototypes warnings

1.4.1
- Apply patch by TK to use __USE_MINGW_ACCESS

Expand Down
18 changes: 9 additions & 9 deletions src/libunrtf/attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
#include "attr.h"
#include "main.h"

extern void starting_body();
extern void starting_text();
extern void starting_body(void);
extern void starting_text(void);

extern int simulate_allcaps;
extern int simulate_smallcaps;
Expand Down Expand Up @@ -446,7 +446,7 @@ attrstack_unexpress_all (AttrStack *stack)
* Returns: None.
*=======================================================================*/
void
attrstack_push ()
attrstack_push (void)
{
AttrStack *new_stack;

Expand Down Expand Up @@ -509,7 +509,7 @@ attr_pop (int attr)
*=======================================================================*/

int
attr_read() {
attr_read(void) {
AttrStack *stack = stack_of_stacks_top;
if (!stack) {
warning_handler ("no stack to read attribute from");
Expand All @@ -534,7 +534,7 @@ attr_read() {
*=======================================================================*/

void
attr_drop_all ()
attr_drop_all (void)
{
AttrStack *stack = stack_of_stacks_top;
if (!stack) {
Expand All @@ -560,7 +560,7 @@ attr_drop_all ()
*=======================================================================*/

void
attrstack_drop ()
attrstack_drop (void)
{
AttrStack *stack = stack_of_stacks_top;
AttrStack *prev_stack;
Expand Down Expand Up @@ -600,7 +600,7 @@ attrstack_drop ()
*=======================================================================*/

void
attr_pop_all()
attr_pop_all(void)
{
AttrStack *stack = stack_of_stacks_top;
if (!stack) {
Expand Down Expand Up @@ -629,7 +629,7 @@ attr_pop_all()
*=======================================================================*/

void
attrstack_express_all() {
attrstack_express_all(void) {
AttrStack *stack = stack_of_stacks_top;
int i;

Expand Down Expand Up @@ -660,7 +660,7 @@ attrstack_express_all() {
*=======================================================================*/

void
attr_pop_dump() {
attr_pop_dump(void) {
AttrStack *stack = stack_of_stacks_top;
int i;

Expand Down
14 changes: 7 additions & 7 deletions src/libunrtf/attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,20 @@ void free_collection(Collection *c);

extern void attr_push(int attr, char* param);

extern void attrstack_push();
extern void attrstack_drop();
extern void attrstack_express_all();
extern void attrstack_push(void);
extern void attrstack_drop(void);
extern void attrstack_express_all(void);

extern int attr_find_pop(int findattr);
extern int attr_pop(int attr);

extern int attr_read();
extern int attr_read(void);

extern void attr_drop_all ();
extern void attr_drop_all (void);

extern void attr_pop_all();
extern void attr_pop_all(void);

extern void attr_pop_dump();
extern void attr_pop_dump(void);

char * attr_get_param(int attr);

Expand Down
24 changes: 12 additions & 12 deletions src/libunrtf/convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static int have_printed_row_begin=FALSE;
static int have_printed_cell_begin=FALSE;
static int have_printed_row_end=FALSE;
static int have_printed_cell_end=FALSE;
static void check_for_table();
static void check_for_table(void);


/* Previously in word_print_core function
Expand Down Expand Up @@ -219,8 +219,8 @@ static int within_header=TRUE;
static const char *hyperlink_base = NULL;


void starting_body();
void starting_text();
void starting_body(void);
void starting_text(void);
void print_with_special_exprs (const char *s);

static int banner_printed=FALSE;
Expand All @@ -234,7 +234,7 @@ static int banner_printed=FALSE;
*=======================================================================*/

void
print_banner () {
print_banner (void) {
if (!banner_printed) {
if (safe_printf(0, op->comment_begin)) fprintf(stderr, TOO_MANY_ARGS, "comment_begin");
printf(" Translation from RTF performed by ");
Expand All @@ -254,7 +254,7 @@ print_banner () {
*=======================================================================*/

void
starting_body ()
starting_body (void)
{
if (!have_printed_body) {
if (!inline_mode) {
Expand Down Expand Up @@ -376,7 +376,7 @@ static int had_ansicpg;
static FontEntry font_table[MAX_FONTS];
static int total_fonts=0;

static void flush_iconv_input();
static void flush_iconv_input(void);
static void accumulate_iconv_input(int ch);

static void
Expand All @@ -388,7 +388,7 @@ set_current_encoding(char *encoding)
}

static void
maybeopeniconv()
maybeopeniconv(void)
{
if (!my_iconv_is_valid(desc)) {
/* This may happen if output begins without a font command */
Expand Down Expand Up @@ -3090,7 +3090,7 @@ enum { SMALL=0, BIG=1 };
*=======================================================================*/

static void
begin_table()
begin_table(void)
{
within_table=TRUE;
have_printed_row_begin = FALSE;
Expand All @@ -3111,7 +3111,7 @@ begin_table()
*=======================================================================*/

void
end_table ()
end_table (void)
{
if (within_table) {
if (!have_printed_cell_end) {
Expand All @@ -3137,7 +3137,7 @@ end_table ()
* Returns: None.
*=======================================================================*/

static void check_for_table()
static void check_for_table(void)
{
//printf("EH: %d %d", coming_pars_that_are_tabular, within_table);

Expand All @@ -3161,7 +3161,7 @@ static void check_for_table()
*=======================================================================*/

void
starting_text() {
starting_text(void) {
if (within_table) {
if (!have_printed_row_begin) {
if (safe_printf(0, op->table_row_begin)) fprintf(stderr, TOO_MANY_ARGS, "table_row_begin");
Expand Down Expand Up @@ -3242,7 +3242,7 @@ ending_paragraph_align (int align)
static char iconv_buffer[IIBS];
static int iconv_cur = 0;
static void
flush_iconv_input()
flush_iconv_input(void)
{
/* fprintf(stderr, "flush_iconv_input: iconv_cur %d\n", iconv_cur);*/
if (iconv_cur <= 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/libunrtf/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
*=======================================================================*/

void
usage ()
usage (void)
{
fprintf(stderr, "Usage: %s\n", USAGE);
exit(-3);
Expand Down
2 changes: 1 addition & 1 deletion src/libunrtf/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static HashItem *hash[256];
*=======================================================================*/

unsigned long
hash_stats ()
hash_stats (void)
{
int i;
unsigned long total=0;
Expand Down
5 changes: 1 addition & 4 deletions src/libunrtf/malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,7 @@ my_strdup (char *src) {
}
/* added by daved */
#include <sys/types.h>
#undef malloc

void *malloc ();


/* Allocate an N-byte block of memory from the heap.
If N is zero, allocate a 1-byte block. */

Expand Down
2 changes: 1 addition & 1 deletion src/libunrtf/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ uint32_t ntohl(uint32_t const net) {
*=======================================================================*/

OutputPersonality*
op_create ()
op_create (void)
{
OutputPersonality* new_op;

Expand Down
2 changes: 1 addition & 1 deletion src/libunrtf/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static unsigned long current_max_length = 1;
*=======================================================================*/

static int
expand_word_buffer ()
expand_word_buffer (void)
{
char *new_ptr;
unsigned long old_length;
Expand Down
4 changes: 2 additions & 2 deletions src/libunrtf/path.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ char *search_in_path(const char *name, char *suffix)
return NULL;
}

int check_dirs()
int check_dirs(void)
{
char *p;
char *colon;
Expand Down Expand Up @@ -100,7 +100,7 @@ int check_dirs()
return(n_path_dirs);
}

void show_dirs()
void show_dirs(void)
{
struct path_dir *path_dir_p;
if(n_path_dirs == 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/libunrtf/path.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ struct path_dir
struct path_dir *next;
};

extern int check_dirs();
extern void show_dirs();
extern int check_dirs(void);
extern void show_dirs(void);
extern char *search_in_path(const char *name, char *suffix);

#endif /* _PATH_H_INCLUDED_ */

0 comments on commit 24815e3

Please sign in to comment.