[mapcode] 04/56: Fixed extraDigits parameter range to 0..2 and fixed copyright message to 2014-2015

Stefan Fritsch sf at moszumanska.debian.org
Wed Nov 2 23:27:25 UTC 2016


This is an automated email from the git hooks/post-receive script.

sf pushed a commit to annotated tag v2.0.2
in repository mapcode.

commit baff8859a0cab023ae903e46b4238b81f3b74257
Author: Rijn Buve <rijn at buve.nl>
Date:   Tue Feb 3 11:36:10 2015 +0100

    Fixed extraDigits parameter range to 0..2 and fixed copyright message to 2014-2015
---
 example/mapcode.cpp | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/example/mapcode.cpp b/example/mapcode.cpp
index 289adca..b3552cd 100644
--- a/example/mapcode.cpp
+++ b/example/mapcode.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Stichting Mapcode Foundation (http://www.mapcode.com)
+ * Copyright (C) 2014-2015 Stichting Mapcode Foundation (http://www.mapcode.com)
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -75,7 +75,7 @@ static double   lonLargestNrOfResults   = 0.0;
  */
 static void usage(const char* appName) {
     printf("MAPCODE (version %s%s)\n", mapcode_cversion, SELF_CHECK ? ", self-checking" : "");
-    printf("Copyright (C) 2014 Stichting Mapcode Foundation\n");
+    printf("Copyright (C) 2014-2015 Stichting Mapcode Foundation\n");
     printf("\n");
     printf("Usage:\n");
     printf("    %s [-d| --decode] <default-territory> <mapcode> [<mapcode> ...]\n", appName);
@@ -604,11 +604,16 @@ int main(const int argc, const char** argv)
             usage(appName);
             return NORMAL_ERROR;
         }
+        if (argc >= 4) {
+            extraDigits = atoi(argv[3]);
+            if ((extraDigits < 0) || (extraDigits > 2)) {
+                fprintf(stderr, "error: parameter extraDigits must be in [0..2]\n\n");
+                usage(appName);
+                return NORMAL_ERROR;
+            }
+        }
         int random = (strcmp(cmd, "-r") == 0) || (strcmp(cmd, "--random") == 0);
         if (random) {
-            if (argc >= 4) {
-                extraDigits = atoi(argv[3]);
-            }
             if (argc == 5) {
                 const int seed = atoi(argv[4]);
                 srand(seed);
@@ -617,16 +622,6 @@ int main(const int argc, const char** argv)
                 srand(time(0));
             }
         }
-        else {
-            if (argc == 4) {
-                extraDigits = atoi(argv[3]);
-                if ((extraDigits < 0) || (extraDigits> 2)) {
-                    fprintf(stderr, "error: parameter extraDigits must be in [0..2]\n\n");
-                    usage(appName);
-                    return NORMAL_ERROR;
-                }
-            }
-        }
         useXYZ = (strstr(cmd, "XYZ") != 0);
 
         // Statistics.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/mapcode.git



More information about the Pkg-grass-devel mailing list