Skip to content

Commit

Permalink
src/viewer/ascii.c: fix unused variables in case of --disable-charset.
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Borodin <[email protected]>
  • Loading branch information
aborodin committed Jan 8, 2015
1 parent 6b5ba76 commit 1968d57
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/viewer/ascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ mcview_wcwidth (const mcview_t * view, int c)
if (g_unichar_iszerowidth (c))
return 0;
}
#else
(void) view;
(void) c;
#endif /* HAVE_CHARSET */
return 1;
}
Expand All @@ -220,6 +223,9 @@ mcview_ismark (const mcview_t * view, int c)
#ifdef HAVE_CHARSET
if (view->utf8)
return g_unichar_ismark (c);
#else
(void) view;
(void) c;
#endif /* HAVE_CHARSET */
return FALSE;
}
Expand All @@ -239,6 +245,9 @@ mcview_is_non_spacing_mark (const mcview_t * view, int c)

return type == G_UNICODE_NON_SPACING_MARK || type == G_UNICODE_ENCLOSING_MARK;
}
#else
(void) view;
(void) c;
#endif /* HAVE_CHARSET */
return FALSE;
}
Expand All @@ -252,6 +261,9 @@ mcview_is_spacing_mark (const mcview_t * view, int c)
#ifdef HAVE_CHARSET
if (view->utf8)
return g_unichar_type (c) == G_UNICODE_SPACING_MARK;
#else
(void) view;
(void) c;
#endif /* HAVE_CHARSET */
return FALSE;
}
Expand All @@ -266,6 +278,8 @@ mcview_isprint (const mcview_t * view, int c)
if (!view->utf8)
c = convert_from_8bit_to_utf_c ((unsigned char) c, view->converter);
return g_unichar_isprint (c);
#else
(void) view;
#endif /* HAVE_CHARSET */
/* TODO this is very-very buggy by design: ticket 3257 comments 0-1 */
return is_printable (c);
Expand Down Expand Up @@ -302,6 +316,8 @@ mcview_char_display (const mcview_t * view, int c, char *s)
/* TODO the is_printable check below will be broken for this */
c = convert_to_display_c (c);
}
#else
(void) view;
#endif /* HAVE_CHARSET */
/* TODO this is very-very buggy by design: ticket 3257 comments 0-1 */
if (!is_printable (c))
Expand All @@ -325,16 +341,16 @@ mcview_char_display (const mcview_t * view, int c, char *s)
static gboolean
mcview_get_next_char (mcview_t * view, mcview_state_machine_t * state, int *c)
{
gboolean result;
int bytes_consumed;

/* Pretend EOF if we reached force_max */
if (view->force_max >= 0 && state->offset >= view->force_max)
return FALSE;

#ifdef HAVE_CHARSET
if (view->utf8)
{
gboolean result;
int bytes_consumed;

*c = mcview_get_utf (view, state->offset, &bytes_consumed, &result);
if (!result)
return FALSE;
Expand Down

0 comments on commit 1968d57

Please sign in to comment.