aboutsummaryrefslogtreecommitdiff
path: root/src/nad2bin.c
diff options
context:
space:
mode:
authorAaron Puchert <aaron.puchert@sap.com>2017-10-20 12:58:10 +0200
committerAaron Puchert <aaron.puchert@sap.com>2017-11-27 14:57:42 +0100
commit3175dce5fcec54fef6299cc8b595d84db5b29cf4 (patch)
tree0c82ae4f4afa9eb44893e1bd7d1f9a884459e2d9 /src/nad2bin.c
parent1f48f4c333bfe135296d3be643ef4981dc401c38 (diff)
downloadPROJ-3175dce5fcec54fef6299cc8b595d84db5b29cf4.tar.gz
PROJ-3175dce5fcec54fef6299cc8b595d84db5b29cf4.zip
Replace some asserts by compile-time assertions
Decisions regarding the size of certain types are always made at compile time, hence this is where the assertion should take place. If the assertions fail, there is now a compiler error.
Diffstat (limited to 'src/nad2bin.c')
-rw-r--r--src/nad2bin.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nad2bin.c b/src/nad2bin.c
index 0001189c..8401df79 100644
--- a/src/nad2bin.c
+++ b/src/nad2bin.c
@@ -1,10 +1,10 @@
/* Convert bivariate ASCII NAD27 to NAD83 tables to NTv2 binary structure */
#include <stdio.h>
#include <stdlib.h>
-#include <assert.h>
#define PJ_LIB__
-#include <projects.h>
+#include "proj_internal.h"
+#include "projects.h"
#define U_SEC_TO_RAD 4.848136811095359935899141023e-12
/************************************************************************/
@@ -177,8 +177,8 @@ int main(int argc, char **argv) {
exit(2);
}
- assert( MAX_TAB_ID == 80 );
- assert( sizeof(int) == 4 ); /* for ct.lim.lam/phi */
+ STATIC_ASSERT( MAX_TAB_ID == 80 );
+ STATIC_ASSERT( sizeof(pj_int32) == 4 ); /* for ct.lim.lam/phi */
memset( header, 0, sizeof(header) );
@@ -267,13 +267,13 @@ int main(int argc, char **argv) {
{
unsigned char achHeader[11*16];
double dfValue;
- int nGSCount = ct.lim.lam * ct.lim.phi;
+ pj_int32 nGSCount = ct.lim.lam * ct.lim.phi;
LP ur;
ur.lam = ct.ll.lam + (ct.lim.lam-1) * ct.del.lam;
ur.phi = ct.ll.phi + (ct.lim.phi-1) * ct.del.phi;
- assert( sizeof(nGSCount) == 4 );
+ STATIC_ASSERT( sizeof(nGSCount) == 4 );
memset( achHeader, 0, sizeof(achHeader) );