Skip to content

Commit 9bf4475

Browse files
committed
testdata: signed size
1 parent dcc627c commit 9bf4475

2 files changed

Lines changed: 21 additions & 21 deletions

File tree

testdata/lang/maps/dst/main.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static so_int main_MapHolder_get(main_MapHolder h, so_String key) {
2525

2626
static so_int main_MapHolder_sum(main_MapHolder h) {
2727
so_int s = 0;
28-
for (so_int _i = 0; _i < (so_int)h.m->cap; _i++) {
28+
for (so_int _i = 0; _i < h.m->cap; _i++) {
2929
if (!h.m->used[_i]) continue;
3030
so_int v = ((so_int*)h.m->vals)[_i];
3131
s += v;
@@ -176,14 +176,14 @@ int main(void) {
176176
{
177177
// Empty literal
178178
so_Map* m = &(so_Map){0};
179-
if ((so_int)m->len != 0) {
179+
if (m->len != 0) {
180180
so_panic("empty literal");
181181
}
182182
}
183183
{
184184
// Make and populate
185185
so_Map* m = so_make_map(so_String, so_int, 3);
186-
if ((so_int)m->len != 0) {
186+
if (m->len != 0) {
187187
so_panic("make initial len");
188188
}
189189
so_map_set(so_String, so_int, m, so_str("a"), 10);
@@ -192,7 +192,7 @@ int main(void) {
192192
if (so_map_get(so_String, so_int, m, so_str("a")) != 10 || so_map_get(so_String, so_int, m, so_str("b")) != 20 || so_map_get(so_String, so_int, m, so_str("c")) != 30) {
193193
so_panic("make values");
194194
}
195-
if ((so_int)m->len != 3) {
195+
if (m->len != 3) {
196196
so_panic("make final len");
197197
}
198198
}
@@ -241,7 +241,7 @@ int main(void) {
241241
if (so_map_get(so_String, so_int, m, so_str("a")) != 99) {
242242
so_panic("overwrite value");
243243
}
244-
if ((so_int)m->len != 1) {
244+
if (m->len != 1) {
245245
so_panic("overwrite len");
246246
}
247247
}
@@ -328,7 +328,7 @@ int main(void) {
328328
// Range: key + value
329329
so_Map* m = so_map_lit(so_int, so_int, 3, ((so_int[]){1, 2, 3}), ((so_int[]){10, 20, 30}));
330330
so_int sum = 0;
331-
for (so_int _i = 0; _i < (so_int)m->cap; _i++) {
331+
for (so_int _i = 0; _i < m->cap; _i++) {
332332
if (!m->used[_i]) continue;
333333
so_int k = ((so_int*)m->keys)[_i];
334334
so_int v = ((so_int*)m->vals)[_i];
@@ -343,7 +343,7 @@ int main(void) {
343343
// Range: key only
344344
so_Map* m = so_map_lit(so_int, so_int, 2, ((so_int[]){10, 20}), ((so_int[]){100, 200}));
345345
so_int sum = 0;
346-
for (so_int _i = 0; _i < (so_int)m->cap; _i++) {
346+
for (so_int _i = 0; _i < m->cap; _i++) {
347347
if (!m->used[_i]) continue;
348348
so_int k = ((so_int*)m->keys)[_i];
349349
sum += k;
@@ -356,7 +356,7 @@ int main(void) {
356356
// Range: value only
357357
so_Map* m = so_map_lit(so_int, so_int, 2, ((so_int[]){10, 20}), ((so_int[]){100, 200}));
358358
so_int sum = 0;
359-
for (so_int _i = 0; _i < (so_int)m->cap; _i++) {
359+
for (so_int _i = 0; _i < m->cap; _i++) {
360360
if (!m->used[_i]) continue;
361361
so_int v = ((so_int*)m->vals)[_i];
362362
sum += v;
@@ -371,7 +371,7 @@ int main(void) {
371371
so_int k = 0;
372372
so_int v = 0;
373373
so_int sum = 0;
374-
for (so_int _i = 0; _i < (so_int)m->cap; _i++) {
374+
for (so_int _i = 0; _i < m->cap; _i++) {
375375
if (!m->used[_i]) continue;
376376
k = ((so_int*)m->keys)[_i];
377377
v = ((so_int*)m->vals)[_i];
@@ -387,7 +387,7 @@ int main(void) {
387387
so_Map* m = so_map_lit(so_String, so_String, 2, ((so_String[]){so_str("hello"), so_str("foo")}), ((so_String[]){so_str("world"), so_str("bar")}));
388388
so_String keys = so_str("");
389389
so_String vals = so_str("");
390-
for (so_int _i = 0; _i < (so_int)m->cap; _i++) {
390+
for (so_int _i = 0; _i < m->cap; _i++) {
391391
if (!m->used[_i]) continue;
392392
so_String k = ((so_String*)m->keys)[_i];
393393
so_String v = ((so_String*)m->vals)[_i];
@@ -405,7 +405,7 @@ int main(void) {
405405
// Range: over struct values
406406
so_Map* m = so_map_lit(so_String, main_Pair, 2, ((so_String[]){so_str("a"), so_str("b")}), ((main_Pair[]){(main_Pair){1, 2}, (main_Pair){3, 4}}));
407407
so_int sum = 0;
408-
for (so_int _i = 0; _i < (so_int)m->cap; _i++) {
408+
for (so_int _i = 0; _i < m->cap; _i++) {
409409
if (!m->used[_i]) continue;
410410
main_Pair v = ((main_Pair*)m->vals)[_i];
411411
sum += v.x + v.y;
@@ -417,44 +417,44 @@ int main(void) {
417417
{
418418
// len: literal
419419
so_Map* m = so_map_lit(so_String, so_int, 3, ((so_String[]){so_str("a"), so_str("b"), so_str("c")}), ((so_int[]){1, 2, 3}));
420-
if ((so_int)m->len != 3) {
420+
if (m->len != 3) {
421421
so_panic("len literal");
422422
}
423423
}
424424
{
425425
// len: empty
426426
so_Map* m = &(so_Map){0};
427-
if ((so_int)m->len != 0) {
427+
if (m->len != 0) {
428428
so_panic("len empty");
429429
}
430430
}
431431
{
432432
// len: grows with set
433433
so_Map* m = so_make_map(so_String, so_int, 3);
434-
if ((so_int)m->len != 0) {
434+
if (m->len != 0) {
435435
so_panic("len make 0");
436436
}
437437
so_map_set(so_String, so_int, m, so_str("a"), 1);
438-
if ((so_int)m->len != 1) {
438+
if (m->len != 1) {
439439
so_panic("len make 1");
440440
}
441441
so_map_set(so_String, so_int, m, so_str("b"), 2);
442-
if ((so_int)m->len != 2) {
442+
if (m->len != 2) {
443443
so_panic("len make 2");
444444
}
445445
}
446446
{
447447
// len: overwrite does not change len
448448
so_Map* m = so_map_lit(so_String, so_int, 1, ((so_String[]){so_str("a")}), ((so_int[]){1}));
449449
so_map_set(so_String, so_int, m, so_str("a"), 99);
450-
if ((so_int)m->len != 1) {
450+
if (m->len != 1) {
451451
so_panic("len overwrite");
452452
}
453453
}
454454
{
455455
// len: in expression
456456
so_Map* m = so_map_lit(so_String, so_int, 2, ((so_String[]){so_str("a"), so_str("b")}), ((so_int[]){1, 2}));
457-
so_int n = (so_int)m->len + 1;
457+
so_int n = m->len + 1;
458458
if (n != 3) {
459459
so_panic("len expr");
460460
}
@@ -492,7 +492,7 @@ int main(void) {
492492
if (so_map_get(so_String, so_int, m, so_str("b")) != 22) {
493493
so_panic("func modify b");
494494
}
495-
if ((so_int)m->len != 2) {
495+
if (m->len != 2) {
496496
so_panic("func modify len");
497497
}
498498
}
@@ -535,7 +535,7 @@ int main(void) {
535535
// Named map type: range
536536
main_StrMap m = so_map_lit(so_String, so_int, 2, ((so_String[]){so_str("a"), so_str("b")}), ((so_int[]){1, 2}));
537537
so_int sum = 0;
538-
for (so_int _i = 0; _i < (so_int)m->cap; _i++) {
538+
for (so_int _i = 0; _i < m->cap; _i++) {
539539
if (!m->used[_i]) continue;
540540
so_int v = ((so_int*)m->vals)[_i];
541541
sum += v;

testdata/std/maps/dst/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static void iterTest(void) {
2424
}
2525
so_map_set(so_String, bool, seen, k, true);
2626
}
27-
if ((so_int)seen->len != maps_Map_Len(so_String, so_int, (&m))) {
27+
if (seen->len != maps_Map_Len(so_String, so_int, (&m))) {
2828
so_panic("missing keys");
2929
}
3030
maps_Map_Free(so_String, so_int, (&m));

0 commit comments

Comments
 (0)