Skip to content

Commit

Permalink
apps - fixing errors wrt const char*
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-dixon committed Oct 13, 2024
1 parent 688a6f7 commit 5242027
Show file tree
Hide file tree
Showing 14 changed files with 62 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@

typedef struct {

char *prog_name; /* program name */

char *name;
char *instance;
const char *prog_name; /* program name */
const char *name;
const char *instance;
int pid;
int debug;

Expand Down
4 changes: 2 additions & 2 deletions codebase/apps/procmap/src/test_procmap/test_mapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ static int get_info(PROCMAP_info_t **return_info_p)
memset ((void *) &request,
(int) 0, (size_t) sizeof(PROCMAP_request_t));

strncpy(request.name, Glob->name, PROCMAP_NAME_MAX);
strncpy(request.name, Glob->name, PROCMAP_NAME_MAX - 1);
strncpy(request.instance, Glob->instance,
PROCMAP_INSTANCE_MAX);
PROCMAP_INSTANCE_MAX - 1);

nprocs = 0;

Expand Down
10 changes: 5 additions & 5 deletions codebase/apps/procmap/src/test_procmap/test_procmap.hh
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@

typedef struct {

char *prog_name; /* program name */
char *param_path_name; /* parameters file path */
char *procmap_host; /* name of server mapper host */
char *name;
char *instance;
const char *prog_name; /* program name */
const char *param_path_name; /* parameters file path */
const char *procmap_host; /* name of server mapper host */
const char *name;
const char *instance;
int do_repeat;
int do_register;
int do_unregister;
Expand Down
10 changes: 10 additions & 0 deletions codebase/apps/radar/src/Lucid/cidd.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@ class Global_data {

bool redraw_horiz;
bool redraw_vert;
bool time_has_changed;
bool field_has_changed;
bool zoom_has_changed;
bool vsect_has_changed;
double ht_has_changed;

time_t prev_time;
int prev_field;
double prev_min_x, prev_min_y, prev_max_x, prev_max_y;
double prev_ht;

// projections

Expand Down
18 changes: 16 additions & 2 deletions codebase/apps/radar/src/Lucid/cidd_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,22 @@ int init_data_space()

// global redraw flags

gd.redraw_horiz = false;
gd.redraw_vert = false;
gd.redraw_horiz = true;
gd.redraw_vert = true;

gd.time_has_changed = true;
gd.field_has_changed = true;
gd.zoom_has_changed = true;
gd.vsect_has_changed = true;
gd.ht_has_changed = true;

gd.prev_time = -1;
gd.prev_field = -1;
gd.prev_min_x = -9999.0;
gd.prev_min_y = -9999.0;
gd.prev_max_x = -9999.0;
gd.prev_max_y = -9999.0;
gd.prev_ht = -9999.0;

// movies

Expand Down
15 changes: 7 additions & 8 deletions codebase/apps/titan/src/verify_grid/get_truth_path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ char *get_truth_path (char *detect_file_path)

{

static char truth_file_path[MAX_PATH_LEN];
static char truth_file_path[MAX_PATH_LEN * 2];

char dir_path[MAX_PATH_LEN];
char *name, file_ext[16];
Expand Down Expand Up @@ -121,9 +121,9 @@ char *get_truth_path (char *detect_file_path)
* the correct subdirectory
*/

sprintf(dir_path, "%s/%.4d%.2d%.2d",
Glob->params.truth_data_dir,
this_dt->year, this_dt->month, this_dt->day);
snprintf(dir_path, MAX_PATH_LEN - 1, "%s/%.4d%.2d%.2d",
Glob->params.truth_data_dir,
this_dt->year, this_dt->month, this_dt->day);

/*
* load file name of the closest scan to the requested time
Expand Down Expand Up @@ -224,11 +224,10 @@ static int find_best_file (char *dir_path,
time_diff = abs ((int) (file_dt.unix_time - search_time));

if (time_diff < *time_error) {
*time_error = time_diff;
sprintf(file_path, "%s%s%s",
dir_path, PATH_DELIM,
dp->d_name);
snprintf(file_path, MAX_PATH_LEN * 2 - 1, "%s%s%s",
dir_path, PATH_DELIM, dp->d_name);
f_count++;

} /*if (time_diff < *time_error) */
Expand Down
2 changes: 1 addition & 1 deletion codebase/apps/titan/src/verify_grid/update_cont.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ static void cont_specified_grid(contingency_t *cont,
FILE* scan_cont_file)

{
static char *routine_name = "cont_specified_grid";
static const char *routine_name = "cont_specified_grid";

static int first_call = TRUE;
static ui08 *truth_grid, *detect_grid;
Expand Down
4 changes: 2 additions & 2 deletions codebase/apps/titan/src/verify_tracks/debug_print.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))

static void print_grid(char *label,
static void print_grid(const char *label,
ui08 **forecast_grid,
ui08 **verify_grid);

Expand Down Expand Up @@ -88,7 +88,7 @@ void debug_print(track_file_handle_t *t_handle,
* print_grid()
*/

static void print_grid(char *label,
static void print_grid(const char *label,
ui08 **forecast_grid,
ui08 **verify_grid)

Expand Down
2 changes: 1 addition & 1 deletion codebase/apps/titan/src/verify_tracks/parse_args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void parse_args(int argc,
char *end_pt;
char usage[BUFSIZ];
char *malloc_debug_str;
char *debug_str;
const char *debug_str;

/*
* set usage string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "verify_tracks.h"

void print_contingency_table(FILE *fout,
char *label,
const char *label,
vt_count_t *count)

{
Expand Down
7 changes: 4 additions & 3 deletions codebase/apps/titan/src/verify_tracks/print_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@

static vt_stats_t *Stats;
static void print_stat(FILE *fout,
char *label,
const char *label,
fl32 *bias_p,
int print_norm);

void print_stats(FILE *fout,
char *heading, vt_stats_t *stats)
const char *heading,
vt_stats_t *stats)

{

Expand Down Expand Up @@ -103,7 +104,7 @@ void print_stats(FILE *fout,
*/

static void print_stat(FILE *fout,
char *label,
const char *label,
fl32 *bias_p,
int print_norm)

Expand Down
4 changes: 2 additions & 2 deletions codebase/apps/titan/src/verify_tracks/verify_tracks.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ extern void perform_verification(storm_file_handle_t *s_handle,
vt_stats_t *total_stats);

extern void print_contingency_table(FILE *fout,
char *label,
const char *label,
vt_count_t *count);

extern void print_stats(FILE *fout,
char *label,
const char *label,
vt_stats_t *stats);

extern void read_params(void);
Expand Down
8 changes: 4 additions & 4 deletions codebase/libs/Mdv/src/include/Mdv/mdv/mdv_dataset.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ extern int MDV_write_dataset(FILE *outfile, MDV_dataset_t *dataset,
extern int MDV_write_dataset_remote(MDV_dataset_t *dataset,
int output_encoding_type,
int swap_chunk_data,
char *output_host,
char *output_dir,
char *output_filename,
char *local_tmp_dir);
const char *output_host,
const char *output_dir,
const char *output_filename,
const char *local_tmp_dir);

/******************************************************************************
* MDV_SET_CHUNK_HDR_OFFSETS: Set the chunk data offsets in all of the chunk
Expand Down
8 changes: 4 additions & 4 deletions codebase/libs/Mdv/src/oldMdv/mdv_dataset.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,10 @@ int MDV_write_dataset(FILE *outfile, MDV_dataset_t *dataset,
int MDV_write_dataset_remote(MDV_dataset_t *dataset,
int output_encoding_type,
int swap_chunk_data,
char *output_host,
char *output_dir,
char *output_filename,
char *local_tmp_dir)
const char *output_host,
const char *output_dir,
const char *output_filename,
const char *local_tmp_dir)
{
static char *routine_name = "MDV_write_dataset_remote";

Expand Down

0 comments on commit 5242027

Please sign in to comment.