Skip to content

Commit 4337aab

Browse files
committed
some cleaning based on cppcheck
1 parent 4d8bb3a commit 4337aab

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

src/inputs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ get_ncurses_event(NCursesEventData *nced, bool *sigint, bool *sigwinch)
354354
* content - new data, inotify event, .. These events are saved, but for this moment ignored.
355355
* Timeout -1 (timeout is infinity), 0 (no any wait), else timeout in ms.
356356
*/
357-
int
357+
static int
358358
_get_pspg_event(NCursesEventData *nced,
359359
bool only_tty_events,
360360
int timeout)

src/pspg.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ SigtermHandler(int sig_num)
251251
}
252252

253253
/* Custom SIGSEGV handler. */
254-
void
254+
static void
255255
SigsegvHandler (int sig)
256256
{
257257
exit_handler();
@@ -299,7 +299,7 @@ max_int(int a, int b)
299299
* The argument "b" should be >= "a" or it should be ignored
300300
* and "a" is used instead "b".
301301
*/
302-
int
302+
static int
303303
trim_to_range(int v, int a, int b)
304304
{
305305
/*
@@ -2157,8 +2157,6 @@ export_to_file(PspgCommand command,
21572157
snprintf(cmdline_clipboard_app, 1024, "wl-copy -t %s", fmt);
21582158
else if (clipboard_application_id == 2)
21592159
snprintf(cmdline_clipboard_app, 1024, "xclip -sel clip");
2160-
else if (clipboard_application_id == 4)
2161-
snprintf(cmdline_clipboard_app, 1024, "clip.exe");
21622160

21632161
if ((pid = rwe_popen(cmdline_clipboard_app, &fin, &fout, &ferr)) == -1)
21642162
{
@@ -4496,7 +4494,7 @@ main(int argc, char *argv[])
44964494
vertical_cursor_column))
44974495
break;
44984496

4499-
if (mark_mode != MARK_MODE_BLOCK || mark_mode != MARK_MODE_COLUMNS)
4497+
if (mark_mode != MARK_MODE_BLOCK && mark_mode != MARK_MODE_COLUMNS)
45004498
{
45014499
throw_selection(&scrdesc, &desc, &mark_mode);
45024500

src/table.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ readfile(Options *opts, DataDesc *desc, StateData *state)
839839
char *newline, *writeptr, *readptr;
840840
int total_dl = 0;
841841

842-
while ((tabptr = memchr(tabptr + 1, '\t', endptr - tabptr)))
842+
while ((tabptr = memchr(((char *) tabptr) + 1, '\t', endptr - tabptr)))
843843
{
844844
tabcount += 1;
845845
}

src/themes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,15 @@ color_index_rgb(unsigned int rgb)
258258

259259
#define RGB(r, g, b) ((((int)(r / 1000.0 * 255.0)) << 16) + (((int)(g / 1000.0 * 255.0)) << 8) + ((int)(b / 1000.0 * 255.0)))
260260

261-
void
261+
static void
262262
deftheme(PspgThemeElements idx, PspgColor fg, PspgColor bg, int attr)
263263
{
264264
memcpy(&themedef[idx][current_themedef_bank].fg, &fg, sizeof(PspgColor));
265265
memcpy(&themedef[idx][current_themedef_bank].bg, &bg, sizeof(PspgColor));
266266
themedef[idx][current_themedef_bank].attr = attr;
267267
}
268268

269-
void
269+
static void
270270
deftheme_rgb(PspgThemeElements idx, unsigned int fg, unsigned int bg, int attr)
271271
{
272272
PspgThemeElement *te = &themedef[idx][current_themedef_bank];

0 commit comments

Comments
 (0)