mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
Parenthesis around some -1.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
51cb5c1644
commit
71bae55f12
@ -553,7 +553,7 @@ mc_search_regex__process_append_str (GString * dest_str, const char *from, gsize
|
||||
char *tmp_str;
|
||||
GString *tmp_string;
|
||||
|
||||
if (len == (gsize) - 1)
|
||||
if (len == (gsize) (-1))
|
||||
len = strlen (from);
|
||||
|
||||
if (*replace_flags == REPLACE_T_NO_TRANSFORM)
|
||||
|
@ -59,7 +59,7 @@ strutils_escape (const char *src, gsize src_len, const char *escaped_chars,
|
||||
|
||||
ret = g_string_new ("");
|
||||
|
||||
if (src_len == (gsize) - 1)
|
||||
if (src_len == (gsize) (-1))
|
||||
src_len = strlen (src);
|
||||
|
||||
for (curr_index = 0; curr_index < src_len; curr_index++)
|
||||
|
@ -320,8 +320,8 @@ int mc_##name (const vfs_path_t *vpath1, const vfs_path_t *vpath2) \
|
||||
if (vpath1 == NULL || vpath2 == NULL) \
|
||||
return -1; \
|
||||
\
|
||||
path_element1 = vfs_path_get_by_index (vpath1, - 1); \
|
||||
path_element2 = vfs_path_get_by_index (vpath2, - 1); \
|
||||
path_element1 = vfs_path_get_by_index (vpath1, (-1)); \
|
||||
path_element2 = vfs_path_get_by_index (vpath2, (-1)); \
|
||||
\
|
||||
if (!vfs_path_element_valid (path_element1) || !vfs_path_element_valid (path_element2) || \
|
||||
path_element1->class != path_element2->class) \
|
||||
|
@ -737,8 +737,8 @@ apply_advanced_chowns (struct stat *sf)
|
||||
message (D_ERROR, MSG_ERROR, _("Cannot chmod \"%s\"\n%s"),
|
||||
lc_fname, unix_error_string (errno));
|
||||
/* call mc_chown only, if mc_chmod didn't fail */
|
||||
else if (mc_chown (vpath, (ch_flags[9] == '+') ? sf->st_uid : (uid_t) - 1,
|
||||
(ch_flags[10] == '+') ? sf->st_gid : (gid_t) - 1) == -1)
|
||||
else if (mc_chown (vpath, (ch_flags[9] == '+') ? sf->st_uid : (uid_t) (-1),
|
||||
(ch_flags[10] == '+') ? sf->st_gid : (gid_t) (-1)) == -1)
|
||||
message (D_ERROR, MSG_ERROR, _("Cannot chown \"%s\"\n%s"),
|
||||
lc_fname, unix_error_string (errno));
|
||||
do_file_mark (current_panel, current_file, 0);
|
||||
@ -759,8 +759,8 @@ apply_advanced_chowns (struct stat *sf)
|
||||
message (D_ERROR, MSG_ERROR, _("Cannot chmod \"%s\"\n%s"),
|
||||
lc_fname, unix_error_string (errno));
|
||||
/* call mc_chown only, if mc_chmod didn't fail */
|
||||
else if (mc_chown (vpath, (ch_flags[9] == '+') ? a_uid : (uid_t) - 1,
|
||||
(ch_flags[10] == '+') ? a_gid : (gid_t) - 1) == -1)
|
||||
else if (mc_chown (vpath, (ch_flags[9] == '+') ? a_uid : (uid_t) (-1),
|
||||
(ch_flags[10] == '+') ? a_gid : (gid_t) (-1)) == -1)
|
||||
message (D_ERROR, MSG_ERROR, _("Cannot chown \"%s\"\n%s"),
|
||||
lc_fname, unix_error_string (errno));
|
||||
|
||||
@ -822,8 +822,8 @@ chown_advanced_cmd (void)
|
||||
fname, unix_error_string (errno));
|
||||
/* call mc_chown only, if mc_chmod didn't fail */
|
||||
else if (mc_chown
|
||||
(fname_vpath, (ch_flags[9] == '+') ? sf_stat->st_uid : (uid_t) - 1,
|
||||
(ch_flags[10] == '+') ? sf_stat->st_gid : (gid_t) - 1) == -1)
|
||||
(fname_vpath, (ch_flags[9] == '+') ? sf_stat->st_uid : (uid_t) (-1),
|
||||
(ch_flags[10] == '+') ? sf_stat->st_gid : (gid_t) (-1)) == -1)
|
||||
message (D_ERROR, MSG_ERROR, _("Cannot chown \"%s\"\n%s"), fname,
|
||||
unix_error_string (errno));
|
||||
vfs_path_free (fname_vpath);
|
||||
|
@ -664,7 +664,7 @@ read_file_system_list (int need_fs_type)
|
||||
me->me_type_malloced = 0;
|
||||
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
|
||||
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
|
||||
me->me_dev = (dev_t) - 1; /* Magic; means not known yet. */
|
||||
me->me_dev = (dev_t) (-1); /* Magic; means not known yet. */
|
||||
|
||||
/* Add to the linked list. */
|
||||
*mtail = me;
|
||||
@ -690,7 +690,7 @@ read_file_system_list (int need_fs_type)
|
||||
me->me_type_malloced = 1;
|
||||
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
|
||||
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
|
||||
me->me_dev = (dev_t) - 1; /* Magic; means not known yet. */
|
||||
me->me_dev = (dev_t) (-1); /* Magic; means not known yet. */
|
||||
|
||||
/* Add to the linked list. */
|
||||
*mtail = me;
|
||||
@ -859,7 +859,7 @@ read_file_system_list (int need_fs_type)
|
||||
me->me_type_malloced = 1;
|
||||
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
|
||||
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
|
||||
me->me_dev = (dev_t) - 1; /* Magic; means not known yet. */
|
||||
me->me_dev = (dev_t) (-1); /* Magic; means not known yet. */
|
||||
|
||||
/* Add to the linked list. */
|
||||
*mtail = me;
|
||||
@ -889,7 +889,7 @@ read_file_system_list (int need_fs_type)
|
||||
me->me_devname = g_strconcat ("/dev/", mnt.mt_dev, (char *) NULL);
|
||||
#endif
|
||||
me->me_mountdir = g_strdup (mnt.mt_filsys);
|
||||
me->me_dev = (dev_t) - 1; /* Magic; means not known yet. */
|
||||
me->me_dev = (dev_t) (-1); /* Magic; means not known yet. */
|
||||
me->me_type = "";
|
||||
me->me_type_malloced = 0;
|
||||
#ifdef GETFSTYP /* SVR3. */
|
||||
@ -940,7 +940,7 @@ read_file_system_list (int need_fs_type)
|
||||
me->me_type_malloced = 1;
|
||||
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
|
||||
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
|
||||
me->me_dev = (dev_t) - 1; /* Magic; means not known yet. */
|
||||
me->me_dev = (dev_t) (-1); /* Magic; means not known yet. */
|
||||
|
||||
/* Add to the linked list. */
|
||||
*mtail = me;
|
||||
@ -1116,7 +1116,7 @@ read_file_system_list (int need_fs_type)
|
||||
me->me_type_malloced = 1;
|
||||
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
|
||||
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
|
||||
me->me_dev = (dev_t) - 1; /* Magic; means not known yet. */
|
||||
me->me_dev = (dev_t) (-1); /* Magic; means not known yet. */
|
||||
|
||||
/* Add to the linked list. */
|
||||
*mtail = me;
|
||||
|
@ -59,7 +59,7 @@
|
||||
/*** global variables ****************************************************************************/
|
||||
|
||||
#define OFF_T_BITWIDTH (unsigned int) (sizeof (off_t) * CHAR_BIT - 1)
|
||||
const off_t INVALID_OFFSET = (off_t) - 1;
|
||||
const off_t INVALID_OFFSET = (off_t) (-1);
|
||||
const off_t OFFSETTYPE_MAX = ((off_t) 1 << (OFF_T_BITWIDTH - 1)) - 1;
|
||||
|
||||
/*** file scope macro definitions ****************************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user