forked from enlightenment/efl
efl src - mark fallthrough switch statements in 3rd party code
in code we importend that doesnt use eina we have warnings of fallthroughs. all o them are commented to be fallthrough so add the attribute there too to have fewer warnings.
This commit is contained in:
parent
12278d27de
commit
932ae95a4e
|
@ -3136,6 +3136,12 @@ get_directive_token(cpp_reader * pfile)
|
||||||
case CPP_POP:
|
case CPP_POP:
|
||||||
if (!CPP_IS_MACRO_BUFFER(CPP_BUFFER(pfile)))
|
if (!CPP_IS_MACRO_BUFFER(CPP_BUFFER(pfile)))
|
||||||
return token;
|
return token;
|
||||||
|
#ifndef __has_attribute
|
||||||
|
# define __has_attribute(x) 0
|
||||||
|
#endif
|
||||||
|
#if __has_attribute(fallthrough)
|
||||||
|
__attribute__((fallthrough));
|
||||||
|
#endif
|
||||||
/* ... else fall though ... */
|
/* ... else fall though ... */
|
||||||
case CPP_HSPACE:
|
case CPP_HSPACE:
|
||||||
case CPP_COMMENT:
|
case CPP_COMMENT:
|
||||||
|
@ -4300,6 +4306,12 @@ skip_if_group(cpp_reader * pfile, int any)
|
||||||
validate_else(pfile,
|
validate_else(pfile,
|
||||||
kt->type ==
|
kt->type ==
|
||||||
T_ELSE ? "#else" : "#endif");
|
T_ELSE ? "#else" : "#endif");
|
||||||
|
#ifndef __has_attribute
|
||||||
|
# define __has_attribute(x) 0
|
||||||
|
#endif
|
||||||
|
#if __has_attribute(fallthrough)
|
||||||
|
__attribute__((fallthrough));
|
||||||
|
#endif
|
||||||
/* this fall through is intened */
|
/* this fall through is intened */
|
||||||
case T_ELIF:
|
case T_ELIF:
|
||||||
if (pfile->if_stack == CPP_BUFFER(pfile)->if_stack)
|
if (pfile->if_stack == CPP_BUFFER(pfile)->if_stack)
|
||||||
|
@ -6748,7 +6760,14 @@ cpp_handle_options(cpp_reader * pfile, int argc, char **argv)
|
||||||
{
|
{
|
||||||
opts->out_fname = "";
|
opts->out_fname = "";
|
||||||
break;
|
break;
|
||||||
} /* else fall through into error */
|
}
|
||||||
|
#ifndef __has_attribute
|
||||||
|
# define __has_attribute(x) 0
|
||||||
|
#endif
|
||||||
|
#if __has_attribute(fallthrough)
|
||||||
|
__attribute__((fallthrough));
|
||||||
|
#endif
|
||||||
|
/* else fall through into error */
|
||||||
default:
|
default:
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2119,6 +2119,12 @@ http_parser_parse_url(const char *buf, size_t buflen, int is_connect,
|
||||||
case s_req_server_with_at:
|
case s_req_server_with_at:
|
||||||
found_at = 1;
|
found_at = 1;
|
||||||
|
|
||||||
|
#ifndef __has_attribute
|
||||||
|
# define __has_attribute(x) 0
|
||||||
|
#endif
|
||||||
|
#if __has_attribute(fallthrough)
|
||||||
|
__attribute__((fallthrough));
|
||||||
|
#endif
|
||||||
/* FALLTROUGH */
|
/* FALLTROUGH */
|
||||||
case s_req_server:
|
case s_req_server:
|
||||||
uf = UF_HOST;
|
uf = UF_HOST;
|
||||||
|
|
|
@ -210,6 +210,12 @@ static void set_wordbreaks(
|
||||||
posLast = posCur;
|
posLast = posCur;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifndef __has_attribute
|
||||||
|
# define __has_attribute(x) 0
|
||||||
|
#endif
|
||||||
|
#if __has_attribute(fallthrough)
|
||||||
|
__attribute__((fallthrough));
|
||||||
|
#endif
|
||||||
/* Fall off */
|
/* Fall off */
|
||||||
|
|
||||||
case WBP_Newline:
|
case WBP_Newline:
|
||||||
|
@ -323,6 +329,12 @@ static void set_wordbreaks(
|
||||||
wbcSeqStart = wbcCur;
|
wbcSeqStart = wbcCur;
|
||||||
posLast = posCur;
|
posLast = posCur;
|
||||||
}
|
}
|
||||||
|
#ifndef __has_attribute
|
||||||
|
# define __has_attribute(x) 0
|
||||||
|
#endif
|
||||||
|
#if __has_attribute(fallthrough)
|
||||||
|
__attribute__((fallthrough));
|
||||||
|
#endif
|
||||||
/* No break on purpose */
|
/* No break on purpose */
|
||||||
case WBP_MidNumLet:
|
case WBP_MidNumLet:
|
||||||
if (((wbcLast == WBP_ALetter) ||
|
if (((wbcLast == WBP_ALetter) ||
|
||||||
|
|
Loading…
Reference in New Issue