From: Joel Rosdahl Date: Sun, 8 Dec 2013 09:10:39 +0000 (+0100) Subject: Minor coding style tweaks X-Git-Tag: v3.2~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b08fc595b03676b0da807498e034588e08030a99;p=thirdparty%2Fccache.git Minor coding style tweaks --- diff --git a/ccache.c b/ccache.c index 90c38e748..4b63c68c4 100644 --- a/ccache.c +++ b/ccache.c @@ -926,7 +926,7 @@ get_object_name_from_cpp(struct args *args, struct mdfour *hash) maximum filename length limits */ input_base = basename(input_file); tmp = strchr(input_base, '.'); - if (tmp != NULL) { + if (tmp) { *tmp = 0; } if (strlen(input_base) > 10) { @@ -1299,7 +1299,7 @@ calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode) "OBJCPLUS_INCLUDE_PATH", /* clang */ NULL }; - for (p = envvars; *p != NULL; ++p) { + for (p = envvars; *p; ++p) { char *v = getenv(*p); if (v) { hash_delimiter(hash, *p); @@ -2204,7 +2204,7 @@ cc_process_args(struct args *args, struct args **preprocessor_args, } output_is_precompiled_header = - actual_language && strstr(actual_language, "-header") != NULL; + actual_language && strstr(actual_language, "-header"); if (!found_c_opt) { if (output_is_precompiled_header) { diff --git a/cleanup.c b/cleanup.c index 8e5e6cde1..0de706258 100644 --- a/cleanup.c +++ b/cleanup.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2002-2006 Andrew Tridgell - * Copyright (C) 2009-2011 Joel Rosdahl + * Copyright (C) 2009-2011, 2013 Joel Rosdahl * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -70,7 +70,7 @@ traverse_fn(const char *fname, struct stat *st) goto out; } - if (strstr(p, ".tmp.") != NULL) { + if (strstr(p, ".tmp.")) { /* delete any tmp files older than 1 hour */ if (st->st_mtime + 3600 < time(NULL)) { x_unlink(fname); diff --git a/conf.c b/conf.c index 1b1b2b7c7..b49ba3c87 100644 --- a/conf.c +++ b/conf.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2012 Joel Rosdahl + * Copyright (C) 2011-2013 Joel Rosdahl * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -58,7 +58,7 @@ parse_env_string(const char *str, void *result, char **errmsg) char **value = (char **)result; free(*value); *value = subst_env_in_string(str, errmsg); - return *value != NULL; + return *value; } static bool diff --git a/execute.c b/execute.c index 2d295d403..9f7dbe97b 100644 --- a/execute.c +++ b/execute.c @@ -58,7 +58,7 @@ win32argvtos(char *prefix, char **argv) } while ((arg = argv[i++])); str = ptr = malloc(l + 1); - if (str == NULL) + if (!str) return NULL; i = 0; diff --git a/language.c b/language.c index 3700476f8..110066ac9 100644 --- a/language.c +++ b/language.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Joel Rosdahl + * Copyright (C) 2010, 2013 Joel Rosdahl * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -147,7 +147,7 @@ extension_for_language(const char *language) bool language_is_supported(const char *language) { - return p_language_for_language(language) != NULL; + return p_language_for_language(language); } bool diff --git a/mdfour.c b/mdfour.c index 6e2f58425..a32183917 100644 --- a/mdfour.c +++ b/mdfour.c @@ -161,7 +161,7 @@ mdfour_update(struct mdfour *md, const unsigned char *in, size_t n) m = md; - if (in == NULL) { + if (!in) { if (!md->finalized) { mdfour_tail(md->tail, md->tail_len); md->finalized = 1;