From 51eb794a567f4205558e2e839cfb1a1d8a058a52 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 11 Mar 2018 14:02:40 +0000 Subject: [PATCH] startrek: make sdcc happier sdcc does weird stuff with static objects constructed inside a function. No idea why - but it's best to keep them outside of it --- Applications/games/startrek.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Applications/games/startrek.c b/Applications/games/startrek.c index a0fe046e..70b6342c 100644 --- a/Applications/games/startrek.c +++ b/Applications/games/startrek.c @@ -1625,14 +1625,14 @@ void insert_in_quadrant(void) return; } +static char *device_name[] = { + "", "Warp Engines", "Short Range Sensors", "Long Range Sensors", + "Phaser Control", "Photon Tubes", "Damage Control", "Shield Control", + "Library-Computer" +}; + void get_device_name(void) { - static char *device_name[] = { - "", "Warp Engines", "Short Range Sensors", "Long Range Sensors", - "Phaser Control", "Photon Tubes", "Damage Control", "Shield Control", - "Library-Computer" - }; - if (r1 < 0 || r1 > 8) r1 = 0; @@ -1663,12 +1663,14 @@ void string_compare(void) return; } +static char *quad_name[] = { "", + "Antares", "Rigel", "Procyon", "Vega", "Canopus", "Altair", + "Sagittarius", "Pollux", "Sirius", "Deneb", "Capella", + "Betelgeuse", "Aldebaran", "Regulus", "Arcturus", "Spica" +}; + void quadrant_name(void) { - static char *quad_name[] = { "", "Antares", "Rigel", "Procyon", "Vega", - "Canopus", "Altair", "Sagittarius", "Pollux", "Sirius", "Deneb", "Capella", - "Betelgeuse", "Aldebaran", "Regulus", "Arcturus", "Spica" - }; static char *sect_name[] = { "", " I", " II", " III", " IV" }; -- 2.34.1