Changeset 82919e07 in git


Ignore:
Timestamp:
07/03/15 00:02:13 (5 years ago)
Author:
Olly Betts <olly@…>
Branches:
line_contents, master, stereo, travis-osx
Children:
c8fcf66
Parents:
c639f73
Message:

src/commands.c: Make data tables const where possible.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rc639f73 r82919e07  
     1Sat Mar 07 00:01:50 GMT 2015  Olly Betts <olly@survex.com>
     2
     3        * src/commands.c: Make data tables const where possible.
     4
    15Fri Mar 06 22:06:41 GMT 2015  Olly Betts <olly@survex.com>
    26
  • src/commands.c

    rc639f73 r82919e07  
    11/* commands.c
    22 * Code for directives
    3  * Copyright (C) 1991-2003,2004,2005,2006,2010,2011,2012,2013,2014 Olly Betts
     3 * Copyright (C) 1991-2003,2004,2005,2006,2010,2011,2012,2013,2014,2015 Olly Betts
    44 *
    55 * This program is free software; you can redistribute it and/or modify
     
    257257} cmds;
    258258
    259 static sztok cmd_tab[] = {
     259static const sztok cmd_tab[] = {
    260260     {"ALIAS",     CMD_ALIAS},
    261261     {"BEGIN",     CMD_BEGIN},
     
    297297
    298298/* ordering must be the same as the units enum */
    299 static real factor_tab[] = {
     299static const real factor_tab[] = {
    300300   1.0, METRES_PER_FOOT, (METRES_PER_FOOT*3.0),
    301301   (M_PI/180.0), (M_PI/200.0), 0.01, (M_PI/180.0/60.0)
     
    305305get_units(unsigned long qmask, bool percent_ok)
    306306{
    307    static sztok utab[] = {
     307   static const sztok utab[] = {
    308308        {"DEGREES",       UNITS_DEGS },
    309309        {"DEGS",          UNITS_DEGS },
     
    348348get_qlist(unsigned long mask_bad)
    349349{
    350    static sztok qtab[] = {
     350   static const sztok qtab[] = {
    351351        {"ALTITUDE",     Q_DZ },
    352352        {"BACKBEARING",  Q_BACKBEARING },
     
    420420cmd_set(void)
    421421{
    422    static sztok chartab[] = {
     422   static const sztok chartab[] = {
    423423        {"BLANK",     SPECIAL_BLANK },
    424424/*FIXME {"CLOSE",     SPECIAL_CLOSE }, */
     
    862862cmd_flags(void)
    863863{
    864    static sztok flagtab[] = {
     864   static const sztok flagtab[] = {
    865865        {"DUPLICATE", FLAGS_DUPLICATE },
    866866        {"NOT",       FLAGS_NOT },
     
    10251025cmd_data(void)
    10261026{
    1027    static sztok dtab[] = {
     1027   static const sztok dtab[] = {
    10281028        {"ALTITUDE",     Dz },
    10291029        {"BACKBEARING",  BackComp },
     
    11061106#define STYLE_UNKNOWN   -1
    11071107
    1108    static sztok styletab[] = {
     1108   static const sztok styletab[] = {
    11091109        {"CARTESIAN",    STYLE_CARTESIAN },
    11101110        {"CYLPOLAR",     STYLE_CYLPOLAR },
     
    14861486cmd_default(void)
    14871487{
    1488    static sztok defaulttab[] = {
     1488   static const sztok defaulttab[] = {
    14891489      { "CALIBRATE", CMD_CALIBRATE },
    14901490      { "DATA",      CMD_DATA },
     
    16011601}
    16021602
    1603 static sztok case_tab[] = {
     1603static const sztok case_tab[] = {
    16041604     {"PRESERVE", OFF},
    16051605     {"TOLOWER",  LOWER},
     
    16391639} cs_class;
    16401640
    1641 static sztok cs_tab[] = {
     1641static const sztok cs_tab[] = {
    16421642     {"CUSTOM", CS_CUSTOM},
    16431643     {"EPSG",   CS_EPSG},       /* EPSG:<number> */
     
    19211921}
    19221922
    1923 static sztok infer_tab[] = {
     1923static const sztok infer_tab[] = {
    19241924     { "EQUATES",       INFER_EQUATES },
    19251925     { "EXPORTS",       INFER_EXPORTS },
     
    19311931};
    19321932
    1933 static sztok onoff_tab[] = {
     1933static const sztok onoff_tab[] = {
    19341934     { "OFF", 0 },
    19351935     { "ON",  1 },
     
    20922092typedef void (*cmd_fn)(void);
    20932093
    2094 static cmd_fn cmd_funcs[] = {
     2094static const cmd_fn cmd_funcs[] = {
    20952095   cmd_alias,
    20962096   cmd_begin,
Note: See TracChangeset for help on using the changeset viewer.