Skip to content
Open
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ LDEPS=$(TAGLIB_LIBS) $(GSTREAMER_LIBS)
ODEPS=$(GSTREAMER_OBJS)

# build variables
CC ?= /usr/bin/cc
CFLAGS += -c -std=c89 -Wall -Wextra -Wno-unused-value $(CDEBUG) $(CDEPS)
CC ?= /usr/bin/cc
CFLAGS += -c -std=c89 -Wall -Wextra -Wno-unused-value -Wstrict-prototypes $(CDEBUG) $(CDEPS)
LIBS += -lm -lncurses -lutil $(LDEPS)

# object files
Expand Down
22 changes: 11 additions & 11 deletions commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ toggle_list **toggleset;
size_t toggleset_size;

void
toggleset_init()
toggleset_init(void)
{
const int max_size = 52; /* since we only have registers a-z and A-Z */
if ((toggleset = calloc(max_size, sizeof(toggle_list*))) == NULL)
Expand All @@ -64,7 +64,7 @@ toggleset_init()
}

void
toggleset_free()
toggleset_free(void)
{
size_t i;
for (i = 0; i < toggleset_size; i++)
Expand Down Expand Up @@ -542,7 +542,7 @@ cmd_display(int argc, char *argv[])
return 1;
}

if(ui_is_init())
if (ui_is_init())
paint_playlist();

return 0;
Expand Down Expand Up @@ -655,7 +655,7 @@ cmd_set(int argc, char *argv[])
/* resize & redraw (if we're past setup & curses is running) */
ui.lwidth = new_width;
ui_resize();
if(player_is_setup && ui_is_init()) {
if (player_is_setup && ui_is_init()) {
ui_clear();
paint_all();
}
Expand Down Expand Up @@ -886,32 +886,32 @@ cmd_playlist(int argc, char *argv[])
return 1;
}

for(x = 0; x < mdb.nplaylists; x++) {
if(!strncmp(argv[1], mdb.playlists[x]->name, strlen(argv[1]))) {
if(idx > -1) {
for (x = 0; x < mdb.nplaylists; x++) {
if (!strncmp(argv[1], mdb.playlists[x]->name, strlen(argv[1]))) {
if (idx > -1) {
idx = -2;
break;
}

if(idx == -1)
if (idx == -1)
idx = x;
}
}

if(idx > -1) {
if (idx > -1) {
setup_viewing_playlist(mdb.playlists[idx]);
ui.active = ui.playlist;
paint_all();
paint_message("jumped to playlist: %s", mdb.playlists[idx]->name);
return 0;
}

if(idx == -1) {
if (idx == -1) {
paint_error("no match for: %s", argv[1]);
return 0;
}

if(idx == -2)
if (idx == -2)
paint_error("no unique match for: %s", argv[1]);

return 0;
Expand Down
8 changes: 4 additions & 4 deletions commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

#include "compat.h"

#include "debug.h"
#include "enums.h"
#include "keybindings.h"
#include "paint.h"
#include "str2argv.h"
#include "vitunes.h"
#include "debug.h"
#include "keybindings.h"

/****************************************************************************
* Toggle-list handling stuff
Expand Down Expand Up @@ -76,8 +76,8 @@ extern toggle_list **toggleset;
extern size_t toggleset_size;

/* initialize and free the toggleset */
void toggleset_init();
void toggleset_free();
void toggleset_init(void);
void toggleset_free(void);

toggle_list *toggle_list_create(int registr, int argc, char *argv[]);
void toggle_list_add_command(toggle_list *t, char *cmd);
Expand Down
6 changes: 3 additions & 3 deletions compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@
/* OpenBSD has fparseln(3), but it must be included thusly */
#if defined(__OpenBSD__)
# include <stdio.h>
# include <util.h>
# include <libgen.h>
# include <util.h>
#endif

/* FreeBSD has fparseln(3), but it must be included thusly */
#if defined(__FreeBSD__)
# include <stdio.h>
# include <sys/types.h>
# include <libutil.h>
# include <stdio.h>
# include <libgen.h>
# include <libutil.h>
#endif

/* Mac OS X has fparseln(3), but it must be included thusly */
Expand Down
32 changes: 16 additions & 16 deletions keybindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ size_t KeyBindingsSize;
size_t KeyBindingsCapacity;

void
kb_increase_capacity()
kb_increase_capacity(void)
{
KeyBinding *new_buffer;
size_t nbytes;
Expand All @@ -275,7 +275,7 @@ kb_increase_capacity()
****************************************************************************/

void
kb_init()
kb_init(void)
{
size_t i;

Expand All @@ -290,7 +290,7 @@ kb_init()
}

void
kb_free()
kb_free(void)
{
free(KeyBindings);
KeyBindingsSize = 0;
Expand Down Expand Up @@ -340,7 +340,7 @@ kb_unbind_key(KeyCode key)
}

void
kb_unbind_all()
kb_unbind_all(void)
{
KeyBindingsSize = 0;
}
Expand Down Expand Up @@ -448,8 +448,8 @@ kb_execute_by_name(const char *name)
if (!kb_str2action(name, &a))
return false;

for(x = 0; x < KeyActionHandlersSize; x++) {
if(a == KeyActionHandlers[x].action) {
for (x = 0; x < KeyActionHandlersSize; x++) {
if (a == KeyActionHandlers[x].action) {
KeyActionHandlers[x].handler(KeyActionHandlers[x].args);
return true;
}
Expand All @@ -465,7 +465,7 @@ kb_execute_by_name(const char *name)
****************************************************************************/

KbaArgs
get_dummy_args()
get_dummy_args(void)
{
KbaArgs dummy = { .direction = -1, .scale = -1, .amount = -1,
.placement = -1, .num = -1 };
Expand Down Expand Up @@ -1605,10 +1605,10 @@ kba_toggle(KbaArgs a)

int _global_input_num = 0;

void gnum_clear()
void gnum_clear(void)
{ _global_input_num = 0; }

int gnum_get()
int gnum_get(void)
{ return _global_input_num; }

void gnum_set(int x)
Expand All @@ -1620,7 +1620,7 @@ void gnum_add(int x)
}

int
gnum_retrieve()
gnum_retrieve(void)
{
int n = 1;
if (gnum_get() > 0) {
Expand All @@ -1639,7 +1639,7 @@ gnum_retrieve()

Direction _global_search_dir = FORWARDS;

Direction search_dir_get()
Direction search_dir_get(void)
{ return _global_search_dir; }

void search_dir_set(Direction dir)
Expand All @@ -1655,7 +1655,7 @@ void search_dir_set(Direction dir)
yank_buffer _yank_buffer;

void
ybuffer_init()
ybuffer_init(void)
{
_yank_buffer.files = calloc(YANK_BUFFER_CHUNK_SIZE, sizeof(meta_info*));
if (_yank_buffer.files == NULL)
Expand All @@ -1666,13 +1666,13 @@ ybuffer_init()
}

void
ybuffer_clear()
ybuffer_clear(void)
{
_yank_buffer.nfiles = 0;
}

void
ybuffer_free()
ybuffer_free(void)
{
free(_yank_buffer.files);
_yank_buffer.capacity = 0;
Expand Down Expand Up @@ -1706,7 +1706,7 @@ ybuffer_add(meta_info *f)
****************************************************************************/

void
redraw_active()
redraw_active(void)
{
if (ui.active == ui.library)
paint_library();
Expand Down Expand Up @@ -1762,7 +1762,7 @@ execute_external_command(const char *cmd)
printf("\nPress ENTER or type command to continue");
fflush(stdout);
raw();
while(!VSIG_QUIT) {
while (!VSIG_QUIT) {
if ((input = getch()) && input != ERR) {
if (input != '\r')
ungetch(input);
Expand Down
22 changes: 11 additions & 11 deletions keybindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ typedef int KeyCode;


/* Keybinding initializing and binding routines */
void kb_init();
void kb_free();
void kb_init(void);
void kb_free(void);
void kb_bind(KeyAction, KeyCode);
void kb_unbind_action(KeyAction);
void kb_unbind_key(KeyCode);
void kb_unbind_all();
void kb_unbind_all(void);
bool kb_execute(KeyCode);
bool kb_execute_by_name(const char *);

Expand Down Expand Up @@ -162,15 +162,15 @@ void kba_toggle(KbaArgs a);
* how the sequence "15j" will move down 15 lines. "15" is the gnum here.
* These are the routines used to init/set/clear the gnum.
*/
void gnum_clear();
void gnum_clear(void);
void gnum_set(int x);
void gnum_add(int x);
int gnum_get(); /* Return current gnum. */
int gnum_retrieve(); /* Return current gnum and then clear it. */
int gnum_get(void); /* Return current gnum. */
int gnum_retrieve(void); /* Return current gnum and then clear it. */


/* These are used to set/use the search direction */
Direction search_dir_get();
Direction search_dir_get(void);
void search_dir_set(Direction d);


Expand All @@ -183,14 +183,14 @@ typedef struct {
} yank_buffer;
extern yank_buffer _yank_buffer;

void ybuffer_init();
void ybuffer_clear();
void ybuffer_free();
void ybuffer_init(void);
void ybuffer_clear(void);
void ybuffer_free(void);
void ybuffer_add(meta_info *f);


/* Misc. handy functions used frequently */
void redraw_active();
void redraw_active(void);
bool match_command_name(const char *s, const char *cmd);
void execute_external_command(const char *cmd);

Expand Down
2 changes: 1 addition & 1 deletion medialib.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ medialib_load(const char *db_file, const char *playlist_dir)

/* free() all memory associated with global media library */
void
medialib_destroy()
medialib_destroy(void)
{
int i;

Expand Down
2 changes: 1 addition & 1 deletion medialib.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ extern medialib mdb;

/* load/free the global media library */
void medialib_load(const char *db_file, const char *playlist_dir);
void medialib_destroy();
void medialib_destroy(void);

/* add/remove playlists to/from the global media library */
void medialib_playlist_add(playlist *p);
Expand Down
Loading