History

73_arm64.c: Avoid taking address of return value.

Edmund Grimley Evans committed 11 years ago

Commit fc119f91 parent 8329fac1 file · +42 −21Browse files

Unified · Split

tests/tests2/73_arm64.c+42−21
@@ -180,24 +180,41 @@ struct hfa34 fr_hfa34(void) { return hfa34; } · 179 unmodified lines
180 180
181void ret(void)181void ret(void)
182{182{
183 struct s1 t1 = fr_s1();
184 struct s2 t2 = fr_s2();
185 struct s3 t3 = fr_s3();
186 struct s4 t4 = fr_s4();
187 struct s5 t5 = fr_s5();
188 struct s6 t6 = fr_s6();
189 struct s7 t7 = fr_s7();
190 struct s8 t8 = fr_s8();
191 struct s9 t9 = fr_s9();
192 struct s10 t10 = fr_s10();
193 struct s11 t11 = fr_s11();
194 struct s12 t12 = fr_s12();
195 struct s13 t13 = fr_s13();
196 struct s14 t14 = fr_s14();
197 struct s15 t15 = fr_s15();
198 struct s16 t16 = fr_s16();
199 struct s17 t17 = fr_s17();
183 printf("Return values:\n");200 printf("Return values:\n");
184 printf("%.1s\n", &fr_s1().x[0]);201 printf("%.1s\n", t1.x);
185 printf("%.2s\n", &fr_s2().x[0]);202 printf("%.2s\n", t2.x);
186 printf("%.3s\n", &fr_s3().x[0]);203 printf("%.3s\n", t3.x);
187 printf("%.4s\n", &fr_s4().x[0]);204 printf("%.4s\n", t4.x);
188 printf("%.5s\n", &fr_s5().x[0]);205 printf("%.5s\n", t5.x);
189 printf("%.6s\n", &fr_s6().x[0]);206 printf("%.6s\n", t6.x);
190 printf("%.7s\n", &fr_s7().x[0]);207 printf("%.7s\n", t7.x);
191 printf("%.8s\n", &fr_s8().x[0]);208 printf("%.8s\n", t8.x);
192 printf("%.9s\n", &fr_s9().x[0]);209 printf("%.9s\n", t9.x);
193 printf("%.10s\n", &fr_s10().x[0]);210 printf("%.10s\n", t10.x);
194 printf("%.11s\n", &fr_s11().x[0]);211 printf("%.11s\n", t11.x);
195 printf("%.12s\n", &fr_s12().x[0]);212 printf("%.12s\n", t12.x);
196 printf("%.13s\n", &fr_s13().x[0]);213 printf("%.13s\n", t13.x);
197 printf("%.14s\n", &fr_s14().x[0]);214 printf("%.14s\n", t14.x);
198 printf("%.15s\n", &fr_s15().x[0]);215 printf("%.15s\n", t15.x);
199 printf("%.16s\n", &fr_s16().x[0]);216 printf("%.16s\n", t16.x);
200 printf("%.17s\n", &fr_s17().x[0]);217 printf("%.17s\n", t17.x);
201 printf("%.1f\n", fr_hfa11().a);218 printf("%.1f\n", fr_hfa11().a);
202 printf("%.1f %.1f\n", fr_hfa12().a, fr_hfa12().b);219 printf("%.1f %.1f\n", fr_hfa12().a, fr_hfa12().b);
203 printf("%.1f %.1f\n", fr_hfa13().a, fr_hfa13().c);220 printf("%.1f %.1f\n", fr_hfa13().a, fr_hfa13().c);
@@ -230,10 +247,14 @@ void myprintf(const char *format, ...) · 26 unmodified lines
230 va_list ap;247 va_list ap;
231 va_start(ap, format);248 va_start(ap, format);
232 for (s = format; *s; s++) {249 for (s = format; *s; s++) {
233 if (match(&s, "%7s"))250 if (match(&s, "%7s")) {
234 printf("%.7s", &va_arg(ap, struct s7).x[0]);251 struct s7 t7 = va_arg(ap, struct s7);
235 else if (match(&s, "%9s"))252 printf("%.7s", t7.x);
236 printf("%.9s", &va_arg(ap, struct s9).x[0]);253 }
254 else if (match(&s, "%9s")) {
255 struct s9 t9 = va_arg(ap, struct s9);
256 printf("%.9s", t9.x);
257 }
237 else if (match(&s, "%hfa11")) {258 else if (match(&s, "%hfa11")) {
238 struct hfa11 x = va_arg(ap, struct hfa11);259 struct hfa11 x = va_arg(ap, struct hfa11);
239 printf("%.1f,%.1f", x.a, x.a);260 printf("%.1f,%.1f", x.a, x.a);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t