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 include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ typedef enum { VAR_RW, VAR_RC, VAR_RO } var_perms;
*/
typedef struct _var
{
char *name;
const char *name;
var_type type;
var_perms perms;
void *ptr;
Expand Down Expand Up @@ -118,7 +118,7 @@ typedef struct _conditional_fmt_field
*/
typedef struct _funcmap
{
char *name;
const char *name;
void (*function)();
int argn;
prog_mode mode;
Expand Down
2 changes: 1 addition & 1 deletion include/formats.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "common.h"

fmt_field *compile_format_string(char *);
fmt_field *compile_format_string(const char *);
char *eval_format(fmt_field *, task *);
void compile_formats();
void free_formats();
Expand Down
2 changes: 1 addition & 1 deletion include/tasknc.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void print_version(void);
void set_curses_mode(const ncurses_mode);
char *str_trim(char *);
int umvaddstr(WINDOW *, const int, const int, const char *, ...) __attribute__((format(printf,4,5)));
int umvaddstr_align(WINDOW *, const int, char *);
int umvaddstr_align(WINDOW *, const int, const char *);
void wipe_screen(WINDOW *, const short, const short);
void wipe_window(WINDOW *);

Expand Down
3 changes: 2 additions & 1 deletion src/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ static void source_fp(const FILE *);
void handle_command(char *cmdstr) /* {{{ */
{
/* accept a command string, determine what action to take, and execute */
char *command, *args, *modestr, *pos;
char *command, *args, *pos;
const char *modestr;
funcmap *fmap;
prog_mode mode;
int ret = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/formats.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static fmt_field *buffer_field(char *, int);
static char *eval_conditional(conditional_fmt_field *, task *);
static char *field_to_str(fmt_field *, bool *, task *);
static void free_format(fmt_field *);
static conditional_fmt_field *parse_conditional(char **);
static conditional_fmt_field *parse_conditional(const char **);

char *append_buffer(char *buffer, const char append, int *bufferlen) /* {{{ */
{
Expand Down Expand Up @@ -78,7 +78,7 @@ void compile_formats() /* {{{ */
cfg.formats.view_compiled = compile_format_string(cfg.formats.view);
} /* }}} */

fmt_field *compile_format_string(char *fmt) /* {{{ */
fmt_field *compile_format_string(const char *fmt) /* {{{ */
{
/* compile a given format string */
fmt_field *head = NULL, *this, *last = NULL;
Expand Down Expand Up @@ -403,7 +403,7 @@ void free_formats() /* {{{ */
free_format(cfg.formats.task_compiled);
} /* }}} */

conditional_fmt_field *parse_conditional(char **str) /* {{{ */
conditional_fmt_field *parse_conditional(const char **str) /* {{{ */
{
/* parse a conditional struct from a string at a position */
conditional_fmt_field *this = calloc(1, sizeof(conditional_fmt_field));
Expand Down
8 changes: 5 additions & 3 deletions src/keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
struct keymap
{
int value;
char *name;
const char *name;
};

/* keymaps {{{ */
Expand Down Expand Up @@ -180,7 +180,8 @@ void add_keybind(const int key, void *function, char *arg, const prog_mode mode)
*/
keybind *this_bind, *new;
int n = 0;
char *modestr, *name;
const char *modestr;
char *name;

/* create new bind */
new = calloc(1, sizeof(keybind));
Expand Down Expand Up @@ -224,7 +225,8 @@ void handle_keypress(const int c, const prog_mode mode) /* {{{ */
* mode - the mode the key was pressed during
*/
keybind *this_bind;
char *modestr, *keyname;
const char *modestr;
char *keyname;
bool match = false;

/* exit if timeout occurred */
Expand Down
7 changes: 4 additions & 3 deletions src/pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "tasknc.h"

/* local functions */
static void pager_window(line *, const bool, int, char *);
static void pager_window(line *, const bool, int, const char *);

/* global variables */
int offset, height, linecount;
Expand All @@ -49,7 +49,8 @@ void help_window() /* {{{ */
/* display a help window */
line *head, *cur, *last;
keybind *this;
char *modestr, *keyname;
const char *modestr;
char *keyname;
static bool help_running = false;

/* check for existing help window */
Expand Down Expand Up @@ -190,7 +191,7 @@ void pager_command(const char *cmdstr, const char *title, const bool fullscreen,
free_lines(head);
} /* }}} */

void pager_window(line *head, const bool fullscreen, int nlines, char *title) /* {{{ */
void pager_window(line *head, const bool fullscreen, int nlines, const char *title) /* {{{ */
{
/**
* page through a linked list of lines
Expand Down
3 changes: 2 additions & 1 deletion src/tasklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ void key_tasklist_toggle_started() /* {{{ */
bool started;
time_t now;
task *cur = get_task_by_position(selline);
char *cmdstr, *action, *actionpast, *reply;
char *cmdstr, *reply;
const char *action, *actionpast;
FILE *cmdout;
int ret;

Expand Down
2 changes: 1 addition & 1 deletion src/tasknc.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ int umvaddstr(WINDOW *win, const int y, const int x, const char *format, ...) /*
return r;
} /* }}} */

int umvaddstr_align(WINDOW *win, const int y, char *str) /* {{{ */
int umvaddstr_align(WINDOW *win, const int y, const char *str) /* {{{ */
{
/* evaluate an aligned string
* win - the window to print the string in
Expand Down
5 changes: 3 additions & 2 deletions src/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ void test_compile_fmt() /* {{{ */
{
/* test compiling a format to a series of fields */
fmt_field *fmts;
char *eval, *teststr;
char *eval;
const char *teststr;

teststr = "first $date $-8program_version $4program_name $10program_author ++?$search_string?SEARCH??++ ++?$active_filter??NO?++ second";
fmts = compile_format_string(teststr);
Expand All @@ -100,7 +101,7 @@ void test_compile_fmt() /* {{{ */
void test_result(const char *testname, const bool passed) /* {{{ */
{
/* print a colored result for a test */
char *color, *msg;
const char *color, *msg;

/* determine color and message */
if (passed)
Expand Down