/* The path to the dependency file (implicit or specified with -MF). */
static char *output_dep;
-/* diagnostic generation information (clang) */
+/* Diagnostic generation information (clang). */
static char *output_dia = NULL;
/*
args_add(args, "-o");
args_add(args, tmp_obj);
- if( output_dia != 0 ) {
- if( output_to_real_object_first ) {
+ if (output_dia) {
+ if (output_to_real_object_first) {
tmp_dia = x_strdup(output_dia);
cc_log("Outputting to final destination: %s", tmp_dia);
} else {
tmp_unlink(tmp_stdout);
tmp_unlink(tmp_stderr);
tmp_unlink(tmp_obj);
- if( tmp_dia != 0 ) {
+ if (tmp_dia) {
tmp_unlink(tmp_dia);
}
failed();
tmp_unlink(tmp_stderr);
tmp_unlink(tmp_obj);
- if( tmp_dia != 0 ) {
+ if (tmp_dia) {
tmp_unlink(tmp_dia);
}
failed();
}
}
- if( tmp_dia != 0 ) {
+ if (tmp_dia) {
if (stat(tmp_dia, &st) != 0) {
cc_log("Failed to stat %s: %s", tmp_dia, strerror(errno));
stats_update(STATS_ERROR);
stats_update(STATS_ERROR);
failed();
}
- } else if (move_uncompressed_file( tmp_dia, cached_dia,
- conf->compression ? conf->compression_level : 0) != 0) {
- cc_log("Failed to move %s to %s: %s", tmp_dia, cached_dia, strerror(errno));
- stats_update(STATS_ERROR);
- failed();
+ } else if (move_uncompressed_file(
+ tmp_dia, cached_dia,
+ conf->compression ? conf->compression_level : 0) != 0) {
+ cc_log("Failed to move %s to %s: %s", tmp_dia, cached_dia,
+ strerror(errno));
+ stats_update(STATS_ERROR);
+ failed();
}
cc_log("Stored in cache: %s", cached_dia);
stat(cached_dia, &st);
}
/* Check if the diagnostic file is there. */
- if ((output_dia != 0) && (stat(cached_dia, &st) != 0)) {
+ if (output_dia && stat(cached_dia, &st) != 0) {
cc_log("Diagnostic file %s not in cache", cached_dia);
return;
}
x_unlink(cached_stderr);
x_unlink(cached_obj);
x_unlink(cached_dep);
- x_unlink(cached_dia);
+ x_unlink(cached_dia);
return;
} else {
cc_log("Created %s from %s", output_obj, cached_obj);
x_unlink(cached_stderr);
x_unlink(cached_obj);
x_unlink(cached_dep);
- x_unlink(cached_dia);
+ x_unlink(cached_dia);
return;
} else {
cc_log("Created %s from %s", output_dep, cached_dep);
}
}
- if ( output_dia != 0 ) {
- cc_log("[from_cache]: output_dia: %s", output_dia);
+ if (output_dia) {
x_unlink(output_dia);
/* only make a hardlink if the cache file is uncompressed */
if (conf->hard_link && !file_is_compressed(cached_dia)) {
} else {
ret = copy_file(cached_dia, output_dia, 0);
}
- cc_log("[from_cache]: ret: %d", ret);
if (ret == -1) {
if (errno == ENOENT) {
x_unlink(output_dia);
x_unlink(cached_stderr);
x_unlink(cached_obj);
- x_unlink(cached_dep);
+ x_unlink(cached_dep);
x_unlink(cached_dia);
return;
} else {
if (produce_dep_file) {
update_mtime(cached_dep);
}
- if(output_dia != 0) {
- update_mtime(cached_dia);
+ if (output_dia) {
+ update_mtime(cached_dia);
}
if (generating_dependencies && mode != FROMCACHE_DIRECT_MODE) {
if (generating_dependencies) {
cc_log("Dependency file: %s", output_dep);
}
- if (output_dia != 0) {
+ if (output_dia) {
cc_log("Diagnostic file: %s", output_dia);
}
cc_log("Object file: %s", output_obj);