Skip to content

Commit 2baae5c

Browse files
committed
Fix new errors reported after updating compiler sources.
1 parent 71c0646 commit 2baae5c

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

MultiSource/Benchmarks/Olden/bh/newbh.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ treeptr old_main(void) {
7777
bodyptr prev=NULL;
7878
int tmp=0, range=((1<<NDIM) << NDIM) / NumNodes;
7979
int bodiesper _Checked[MAX_NUM_NODES];
80-
bodyptr ptrper _Checked[MAX_NUM_NODES];
80+
bodyptr ptrper _Checked[MAX_NUM_NODES] = { 0 };
8181

8282
srand(123);/* set random generator */
8383

@@ -95,7 +95,7 @@ treeptr old_main(void) {
9595
/* Creates a list of bodies */
9696
for (i=0; i < 32; i++)
9797
{
98-
datapoints points;
98+
datapoints points = { 0.0 };
9999
int processor= i/(32/NumNodes);
100100

101101
points=uniform_testdata(processor, nbody/32, i+1);
@@ -401,7 +401,7 @@ cellptr cell_alloc(int p)
401401

402402
datapoints uniform_testdata(int proc, int nbodyx, int seedfactor)
403403
{
404-
datapoints retval;
404+
datapoints retval = { 0.0 };
405405
real rsc, vsc, r, v, x, y;
406406
bodyptr head = NULL, p = NULL, prev = NULL;
407407
register int i;
@@ -652,7 +652,7 @@ void gravstep(real rsize, nodeptr rt, bodyptr p, int nstep, real dthf)
652652

653653
void hackgrav(bodyptr p, real rsize, nodeptr rt)
654654
{
655-
hgstruct hg;
655+
hgstruct hg = { 0 };
656656
real szsq;
657657

658658
NOTEST();
@@ -840,7 +840,7 @@ void expandbox(bodyptr p, treeptr t, int nsteps, int proc)
840840
int k;
841841
vector rmid;
842842
cellptr newt = NULL;
843-
tree tmp;
843+
tree tmp = { 0.0 };
844844
real rsize;
845845
int inbox;
846846

MultiSource/Benchmarks/Olden/bh/walksub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ hgstruct walksub(nodeptr p, real dsq, real tolsq, hgstruct hg, int level)
2424
{
2525
register int k, i;
2626
register nodeptr r = NULL;
27-
nodeptr tmp _Checked[NSUB];
27+
nodeptr tmp _Checked[NSUB] = { 0 };
2828

2929

3030
if (subdivp(p, dsq, tolsq, hg)) { /* should p be opened? */

MultiSource/Benchmarks/Olden/bisort/bitonic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ int random(int seed) {
6464

6565
ptr<HANDLE> RandTree(int n, int seed, int node, int level) {
6666
int next_val,my_name;
67-
future_cell_int f_left, f_right;
67+
future_cell_int f_left = { 0 }, f_right = { 0 };
6868
ptr<HANDLE> h = NIL;
6969
my_name=foo++;
7070
if (n > 1) {

MultiSource/Benchmarks/Olden/mst/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ typedef struct fc_br {
1616

1717
static BlueReturn BlueRule(Vertex inserted, Vertex vlist)
1818
{
19-
BlueReturn retval;
19+
BlueReturn retval = { 0 };
2020
Vertex tmp = NULL, prev = NULL;
2121
Hash hash = NULL;
2222
int dist,dist2;
@@ -84,7 +84,7 @@ static BlueReturn BlueRule(Vertex inserted, Vertex vlist)
8484
static Vertex MyVertexList = NULL;
8585

8686
static BlueReturn Do_all_BlueRule(Vertex inserted, int nproc, int pn) {
87-
future_cell_BlueReturn fcleft;
87+
future_cell_BlueReturn fcleft = { 0 };
8888
BlueReturn retright;
8989

9090
if (nproc > 1) {
@@ -122,7 +122,7 @@ static int ComputeMst(Graph graph,int numproc,int numvert)
122122
printf("Compute phase 2\n");
123123
while (numvert)
124124
{
125-
BlueReturn br;
125+
BlueReturn br = { 0 };
126126

127127
br = Do_all_BlueRule(inserted,numproc,0);
128128
inserted = br.vert;

MultiSource/Benchmarks/Olden/mst/makegraph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static void AddEdges(int count1, Graph retval, int numproc,
4343
int perproc, int numvert, int j)
4444
{
4545
Vertex tmp = NULL;
46-
VertexArray helper checked[MAXPROC];
46+
VertexArray helper checked[MAXPROC] = { 0 };
4747
int i;
4848

4949
for (i=0; i<numproc; i++) {

MultiSource/Benchmarks/Ptrdist/ks/KS-1.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ ReadNetList(_Nt_array_ptr<char> fname)
6565
(*prev).module = atol(strtok(NULL, " \t\n"))-1;
6666
(*prev).next = NULL;
6767
_Nt_array_ptr<char> tok = NULL;
68-
while ((tok = strtok(NULL, " \t\n")) != NULL) {
68+
// Checked C: TODO: return bounds-safe interface being lost.
69+
while ((tok = (_Nt_array_ptr<char>) strtok(NULL, " \t\n")) != NULL) {
6970
TRY(node = calloc(1, sizeof(Module)),
7071
node != NULL, "ReadData",
7172
"unable to allocate a module list node", 0, 0, 0,

0 commit comments

Comments
 (0)