scanf("%x") knows to eat up this prefix[1][2], so we don't need to do this
ourselves.
[1] K&R's "The C Programming Language" documents "%x" as "hexadecimal
integer (with or without leading 0x or 0X)"
[2] http://pubs.opengroup.org/onlinepubs/9699919799/functions/scanf.html
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Note: considering that this feature hasn't worked, we may consider removing it
entirely or partially (e.g., escaping) in order to simplify the code, as nobody
has grown used to it. It seems, based on the "hex mode" mentioned in the manual
page, that in the past there was no "normal" search in hex mode, and quoted
strings were the only easy way to look for text. This is no longer the case
nowadays.
Note: the characters in the quoted string are copied out as-is to the regexp.
No regexp-quoting is currently done. We may want to revisit this issue when we
work on ticket #3695.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
sscanf() returns EOF when it reaches the end of the string. Our code
erroneously interprets this as if a number was read. The fix: we test for an
explicit '1'.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
According to the LISP users this file extension can only be
seen in old projects and nowadays it's much more common in
the computer graphics applications for the OpenCL programs.
This is a part of work related on adding OpenCL syntax highlight
to mcedit. See tocket #3690 for the details.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Simplify "configure: checking ..." messages.
* m4.include/fsusage.m4 (gl_FILE_SYSTEM_USAGE): Update copyright
years. Use AC_MSG_CHECKING instead of AC_MSG_NOTICE.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Compiler with my_exit() 'noreturn' knowledge will complain about
never reachable break statement.
Reported by clang compiler.
(Maybe there is a better code sequence)
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
utilvfs.c: In function 'vfs_die':
utilvfs.c:354:1: warning: function might be candidate for attribute 'noreturn' [-Wsuggest-attribute=noreturn]
vfs_die (const char *m)
^~~~~~~
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
utilunix.c:360:1: error: function might be candidate for attribute 'noreturn' [-Wsuggest-attribute=noreturn]
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
edit.c: In function 'edit_move_block_to_left':
edit.c:1652:13: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
for (i = 1; i <= del_tab_width; i++)
^~~
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
serialize.c: In function 'mc_serialize_str':
serialize.c:116:34: error: format '%zd' expects argument of type 'signed size_t', but argument 3 has type 'size_t {aka long unsigned int}' [-Werror=format=]
return g_strdup_printf ("%c%zd" SRLZ_DELIM_S "%s", prefix, strlen (data), data);
^
serialize.c:130:19: error: format '%zd' expects argument of type 'signed size_t', but argument 5 has type 'size_t {aka long unsigned int}' [-Werror=format=]
#define FUNC_NAME "mc_serialize_str()"
^
serialize.c:175:22: note: in expansion of macro 'FUNC_NAME'
FUNC_NAME
^~~~~~~~~
serialize.c:130:19: error: format '%zd' expects argument of type 'signed size_t', but argument 6 has type 'size_t {aka long unsigned int}' [-Werror=format=]
#define FUNC_NAME "mc_serialize_str()"
^
serialize.c:175:22: note: in expansion of macro 'FUNC_NAME'
FUNC_NAME
^~~~~~~~~
serialize.c: In function 'mc_deserialize_config':
serialize.c:267:19: error: format '%zd' expects argument of type 'signed size_t', but argument 3 has type 'size_t {aka long unsigned int}' [-Werror=format=]
#define FUNC_NAME "mc_deserialize_config()"
^
serialize.c:269:35: note: in expansion of macro 'FUNC_NAME'
prepend_error_message (error, FUNC_NAME " at %zd", current_position + 1); \
^~~~~~~~~
serialize.c:301:17: note: in expansion of macro 'prepend_error_and_exit'
prepend_error_and_exit ();
^~~~~~~~~~~~~~~~~~~~~~
serialize.c:267:19: error: format '%zd' expects argument of type 'signed size_t', but argument 3 has type 'size_t {aka long unsigned int}' [-Werror=format=]
#define FUNC_NAME "mc_deserialize_config()"
^
serialize.c:269:35: note: in expansion of macro 'FUNC_NAME'
prepend_error_message (error, FUNC_NAME " at %zd", current_position + 1); \
^~~~~~~~~
serialize.c:313:17: note: in expansion of macro 'prepend_error_and_exit'
prepend_error_and_exit ();
^~~~~~~~~~~~~~~~~~~~~~
serialize.c:267:19: error: format '%zd' expects argument of type 'signed size_t', but argument 3 has type 'size_t {aka long unsigned int}' [-Werror=format=]
#define FUNC_NAME "mc_deserialize_config()"
^
serialize.c:269:35: note: in expansion of macro 'FUNC_NAME'
prepend_error_message (error, FUNC_NAME " at %zd", current_position + 1); \
^~~~~~~~~
serialize.c:325:17: note: in expansion of macro 'prepend_error_and_exit'
prepend_error_and_exit ();
^~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
midnight.c: In function 'quit_cmd_internal':
midnight.c:1027:31: error: format '%zd' expects argument of type 'signed size_t', but argument 4 has type 'size_t {aka long unsigned int}' [-Werror=format=]
"You have %zd opened screens. Quit anyway?", n), n);
^
midnight.c:1026:31: error: format '%zd' expects argument of type 'signed size_t', but argument 4 has type 'size_t {aka long unsigned int}' [-Werror=format=]
ngettext ("You have %zd opened screen. Quit anyway?",
^
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
info.c: In function 'info_show_info':
info.c:193:29: error: format '%X' expects argument of type 'unsigned int', but argument 2 has type 'int' [-Werror=format=]
tty_printf (" (%Xh)", myfs_stats.type);
^
info.c:239:51: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'long unsigned int' [-Werror=format=]
tty_printf (ngettext (" (%ld block)", " (%ld blocks)",
^
info.c:239:35: error: format '%ld' expects argument of type 'long int', but argument 2 has type 'long unsigned int' [-Werror=format=]
tty_printf (ngettext (" (%ld block)", " (%ld blocks)",
^
info.c:259:23: error: format '%X' expects argument of type 'unsigned int', but argument 2 has type 'int' [-Werror=format=]
tty_printf (_("Location: %Xh:%Xh"), (int) st.st_dev, (int) st.st_ino);
^
info.c:259:21: note: in expansion of macro '_'
tty_printf (_("Location: %Xh:%Xh"), (int) st.st_dev, (int) st.st_ino);
^
info.c:259:23: error: format '%X' expects argument of type 'unsigned int', but argument 3 has type 'int' [-Werror=format=]
tty_printf (_("Location: %Xh:%Xh"), (int) st.st_dev, (int) st.st_ino);
^
info.c:259:21: note: in expansion of macro '_'
tty_printf (_("Location: %Xh:%Xh"), (int) st.st_dev, (int) st.st_ino);
^
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
hex.c: In function 'mc_search__hex_translate_to_regex':
hex.c:79:39: error: format '%x' expects argument of type 'unsigned int *', but argument 3 has type 'int *' [-Wformat=]
if (sscanf (tmp_str + loop, "%x%n", &val, &ptr))
^
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>