[geofence] make arrays of pointers const

main-solar-only
Richard Meadows 2016-08-07 10:25:08 +01:00
rodzic d64bba5b43
commit 35b4343573
14 zmienionych plików z 350 dodań i 360 usunięć

Wyświetl plik

@ -15,7 +15,7 @@
* struct representing all we need to know about a aprs zone
*/
struct aprs_zone_t {
const int16_t** outlines;
const int16_t* const * outlines;
const uint16_t outline_count;
const uint16_t* outline_lengths;
int32_t frequency;

Wyświetl plik

@ -10,7 +10,7 @@
#include "samd20.h"
const int16_t* no_aprs_outlines[27];
const int16_t* const no_aprs_outlines[27];
const uint16_t no_aprs_outline_lengths[27];
#endif /* GEOFENCE_NO_APRS_H */

Wyświetl plik

@ -15,7 +15,7 @@
* struct representing all we need to know about a prefix
*/
struct prefix_t {
const int16_t** outlines;
const int16_t* const * outlines;
const uint16_t outline_count;
const uint16_t* outline_lengths;
char* prefix;

Wyświetl plik

@ -10,7 +10,7 @@
#include "samd20.h"
const int16_t* telemetry_outlines[5];
const int16_t* const telemetry_outlines[5];
const uint16_t telemetry_outline_lengths[5];
#endif /* GEOFENCE_TELEMETRY_H */

Wyświetl plik

@ -194,7 +194,7 @@ const int16_t alpha_outline_11[] = {
-14635, 6849,
};
const int16_t* alpha_outlines[] = {
const int16_t* const alpha_outlines[] = {
alpha_outline_1,
alpha_outline_2,
alpha_outline_3,
@ -505,7 +505,7 @@ const int16_t charlie_outline_23[] = {
-12164, -8241,
};
const int16_t* charlie_outlines[] = {
const int16_t* const charlie_outlines[] = {
charlie_outline_1,
charlie_outline_2,
charlie_outline_3,
@ -645,7 +645,7 @@ const int16_t bravo_outline_9[] = {
32400, -18601,
};
const int16_t* bravo_outlines[] = {
const int16_t* const bravo_outlines[] = {
bravo_outline_1,
bravo_outline_2,
bravo_outline_3,
@ -728,7 +728,7 @@ const int16_t echo_outline_2[] = {
26131, -2909,
};
const int16_t* echo_outlines[] = {
const int16_t* const echo_outlines[] = {
echo_outline_1,
echo_outline_2,
};
@ -806,7 +806,7 @@ const int16_t delta_outline_5[] = {
-10470, 2648,
};
const int16_t* delta_outlines[] = {
const int16_t* const delta_outlines[] = {
delta_outline_1,
delta_outline_2,
delta_outline_3,
@ -894,7 +894,7 @@ const int16_t golf_outline_1[] = {
-10934, 1873,
};
const int16_t* golf_outlines[] = {
const int16_t* const golf_outlines[] = {
golf_outline_1,
};
const uint16_t golf_outline_lengths[] = {
@ -923,7 +923,7 @@ const int16_t foxtrot_outline_2[] = {
23557, 13288,
};
const int16_t* foxtrot_outlines[] = {
const int16_t* const foxtrot_outlines[] = {
foxtrot_outline_1,
foxtrot_outline_2,
};
@ -1035,7 +1035,7 @@ const int16_t india_outline_3[] = {
22645, 13539,
};
const int16_t* india_outlines[] = {
const int16_t* const india_outlines[] = {
india_outline_1,
india_outline_2,
india_outline_3,
@ -1107,7 +1107,7 @@ const int16_t kilo_outline_1[] = {
-12062, -8280,
};
const int16_t* kilo_outlines[] = {
const int16_t* const kilo_outlines[] = {
kilo_outline_1,
};
const uint16_t kilo_outline_lengths[] = {
@ -1187,7 +1187,7 @@ const int16_t juliet_outline_5[] = {
23371, 13511,
};
const int16_t* juliet_outlines[] = {
const int16_t* const juliet_outlines[] = {
juliet_outline_1,
juliet_outline_2,
juliet_outline_3,
@ -2087,7 +2087,7 @@ const int16_t mike_outline_43[] = {
-11374, -21391,
};
const int16_t* mike_outlines[] = {
const int16_t* const mike_outlines[] = {
mike_outline_1,
mike_outline_2,
mike_outline_3,

Wyświetl plik

@ -1251,7 +1251,7 @@ const int16_t no_aprs_outline_27[] = {
3705, 15090,
};
const int16_t* no_aprs_outlines[] = {
const int16_t* const no_aprs_outlines[] = {
#if APRS_USE_GEOFENCE
no_aprs_outline_1,
no_aprs_outline_2,

Wyświetl plik

@ -438,7 +438,7 @@ const int16_t telemetry_outline_5[] = {
9669, 4349,
};
const int16_t* telemetry_outlines[] = {
const int16_t* const telemetry_outlines[] = {
#if TELEMETRY_USE_GEOFENCE
telemetry_outline_1,
telemetry_outline_2,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -38,7 +38,7 @@
" print >>header, \" * struct representing all we need to know about a aprs zone\"\n",
" print >>header, \" */\"\n",
" print >>header, \"struct aprs_zone_t {\"\n",
" print >>header, \" const int16_t** outlines;\"\n",
" print >>header, \" const int16_t* const * outlines;\"\n",
" print >>header, \" const uint16_t outline_count;\"\n",
" print >>header, \" const uint16_t* outline_lengths;\"\n",
" print >>header, \" int32_t frequency;\"\n",
@ -55,7 +55,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 19
"prompt_number": 37
},
{
"cell_type": "code",
@ -83,7 +83,7 @@
" print >>f, \"\"\n",
" \n",
" # Print an array of outlines\n",
" print >>f, \"const int16_t* {0}_outlines[] = {{\".format(zone['name'].lower())\n",
" print >>f, \"const int16_t* const {0}_outlines[] = {{\".format(zone['name'].lower())\n",
" for o in range(len(zone['simple_outlines'])): # foreach of the countries outlines\n",
" print >>f, \" {0}_{1},\".format(zone['name'].lower() + \"_outline\", o+1)\n",
" print >>f, \"};\"\n",
@ -99,7 +99,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 20
"prompt_number": 38
},
{
"cell_type": "code",
@ -127,7 +127,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 21
"prompt_number": 39
},
{
"cell_type": "code",
@ -163,7 +163,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 22
"prompt_number": 40
},
{
"cell_type": "markdown",
@ -196,7 +196,7 @@
" print >>header, \" * struct representing all we need to know about a prefix\"\n",
" print >>header, \" */\"\n",
" print >>header, \"struct prefix_t {\"\n",
" print >>header, \" const int16_t** outlines;\"\n",
" print >>header, \" const int16_t* const * outlines;\"\n",
" print >>header, \" const uint16_t outline_count;\"\n",
" print >>header, \" const uint16_t* outline_lengths;\"\n",
" print >>header, \" char* prefix;\"\n",
@ -210,7 +210,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 23
"prompt_number": 41
},
{
"cell_type": "code",
@ -240,7 +240,7 @@
" print >>f, \"\"\n",
" \n",
" # Print an array of outlines\n",
" print >>f, \"const int16_t* {0}_outlines[] = {{\".format(prefix_text)\n",
" print >>f, \"const int16_t* const {0}_outlines[] = {{\".format(prefix_text)\n",
" for o in range(len(prefix['prefix_outlines'])): # foreach of the countries outlines\n",
" print >>f, \" {0}_{1},\".format(prefix_text + \"_outline\", o+1)\n",
" print >>f, \"};\"\n",
@ -256,7 +256,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 24
"prompt_number": 42
},
{
"cell_type": "code",
@ -286,7 +286,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 25
"prompt_number": 43
},
{
"cell_type": "code",
@ -322,7 +322,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 26
"prompt_number": 44
},
{
"cell_type": "markdown",
@ -350,7 +350,7 @@
" print >>header, \"\"\n",
" print >>header, \"#include \\\"samd20.h\\\"\"\n",
" print >>header, \"\"\n",
" print >>header, \"const int16_t* no_aprs_outlines[{0}];\".format(len(outlines))\n",
" print >>header, \"const int16_t* const no_aprs_outlines[{0}];\".format(len(outlines))\n",
" print >>header, \"const uint16_t no_aprs_outline_lengths[{0}];\".format(len(outlines))\n",
" print >>header, \"\"\n",
" print >>header, \"#endif /* GEOFENCE_NO_APRS_H */\""
@ -358,7 +358,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 27
"prompt_number": 45
},
{
"cell_type": "code",
@ -384,7 +384,7 @@
" print >>f, \"\"\n",
" \n",
" # Print an array of outlines\n",
" print >>f, \"const int16_t* no_aprs_outlines[] = {\"\n",
" print >>f, \"const int16_t* const no_aprs_outlines[] = {\"\n",
" print >>f, \"#if APRS_USE_GEOFENCE\"\n",
" for o in range(len(outlines)): # foreach of the outlines\n",
" print >>f, \" no_aprs_outline_{0},\".format(o+1)\n",
@ -402,7 +402,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 28
"prompt_number": 46
},
{
"cell_type": "code",
@ -437,7 +437,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 29
"prompt_number": 47
},
{
"cell_type": "markdown",
@ -465,7 +465,7 @@
" print >>header, \"\"\n",
" print >>header, \"#include \\\"samd20.h\\\"\"\n",
" print >>header, \"\"\n",
" print >>header, \"const int16_t* telemetry_outlines[{0}];\".format(len(outlines))\n",
" print >>header, \"const int16_t* const telemetry_outlines[{0}];\".format(len(outlines))\n",
" print >>header, \"const uint16_t telemetry_outline_lengths[{0}];\".format(len(outlines))\n",
" print >>header, \"\"\n",
" print >>header, \"#endif /* GEOFENCE_TELEMETRY_H */\""
@ -473,7 +473,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 30
"prompt_number": 48
},
{
"cell_type": "code",
@ -499,7 +499,7 @@
" print >>f, \"\"\n",
" \n",
" # Print an array of outlines\n",
" print >>f, \"const int16_t* telemetry_outlines[] = {\"\n",
" print >>f, \"const int16_t* const telemetry_outlines[] = {\"\n",
" print >>f, \"#if TELEMETRY_USE_GEOFENCE\"\n",
" for o in range(len(outlines)): # foreach of the outlines\n",
" print >>f, \" telemetry_outline_{0},\".format(o+1)\n",
@ -517,7 +517,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 31
"prompt_number": 49
},
{
"cell_type": "code",
@ -552,7 +552,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 32
"prompt_number": 50
},
{
"cell_type": "markdown",
@ -585,7 +585,7 @@
" print >>header, \" * struct representing all we need to know about a country\"\n",
" print >>header, \" */\"\n",
" print >>header, \"struct country_t {\"\n",
" print >>header, \" const int16_t** outlines;\"\n",
" print >>header, \" const int16_t* const * outlines;\"\n",
" print >>header, \" const int16_t outline_count;\"\n",
" print >>header, \" const uint16_t* outline_lengths;\"\n",
" print >>header, \" char* name;\"\n",
@ -601,7 +601,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 33
"prompt_number": 51
},
{
"cell_type": "code",
@ -628,7 +628,7 @@
" print >>f, \"\"\n",
" \n",
" # Print an array of outlines\n",
" print >>f, \"const int16_t* {0}_outlines[] = {{\".format(country['isocode'].lower())\n",
" print >>f, \"const int16_t* const {0}_outlines[] = {{\".format(country['isocode'].lower())\n",
" for o in range(len(country['simple_outlines'])): # foreach of the countries outlines\n",
" print >>f, \" {0}_{1},\".format(country['isocode'].lower() + \"_outline\", o+1)\n",
" print >>f, \"};\"\n",
@ -643,7 +643,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 34
"prompt_number": 52
},
{
"cell_type": "code",
@ -671,7 +671,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 35
"prompt_number": 53
},
{
"cell_type": "code",
@ -709,7 +709,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 36
"prompt_number": 54
},
{
"cell_type": "code",
@ -718,7 +718,7 @@
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 36
"prompt_number": 54
}
],
"metadata": {}