From 284894c7e18781764ca6b9aa90d2d635368e9ec9 Mon Sep 17 00:00:00 2001 From: Don Cross Date: Tue, 9 Jul 2019 16:35:15 -0400 Subject: [PATCH] Updated Windows build process. Fixed C compiler warnings that show up on Windows but not Linux. Trim trailing whitespace for target code. Generate Python documentation. --- generate/codegen.c | 4 ++-- generate/makedoc.bat | 10 ++++++++++ source/python/README.md | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/generate/codegen.c b/generate/codegen.c index a9f810e1..223b603c 100644 --- a/generate/codegen.c +++ b/generate/codegen.c @@ -664,7 +664,7 @@ static int ScanRealArray( return LogError(context, "Invalid value for numExpected=%d\n", numExpected); /* Split the line into space delimited tokens. */ - len = strlen(line); + len = (int)strlen(line); inspace = 1; t = 0; for (i=0; i < len; ++i) @@ -1006,7 +1006,7 @@ static int OptAddSolJS(cg_context_t *context, const double *data) static int OptAddSol(cg_context_t *context) { - int error; + int error = 1; FILE *infile; int lnum; const char *filename = "model_data/addsol.txt"; diff --git a/generate/makedoc.bat b/generate/makedoc.bat index 8aa6bf37..85f33c09 100644 --- a/generate/makedoc.bat +++ b/generate/makedoc.bat @@ -24,6 +24,12 @@ if errorlevel 1 ( exit /b 1 ) +echo.Trimming trailing whitespace in target code. +for %%f in (..\source\c\astronomy.c ..\source\js\astronomy.js ..\source\python\astronomy.py) do ( + node trimspace.js %%f + if errorlevel 1 (exit /b 1) +) + if not defined CLOSURE ( REM You can customize where the Google Closure Compiler jar file REM is located by setting the environment variable CLOSURE @@ -118,4 +124,8 @@ if exist generate_c_docs ( echo.Skipping generation of C documentation because file generate_c_docs does not exist. ) +echo.Generating Python documentation. +..\pydown\pydown.py ..\source\python\astronomy.py ..\source\python\README.md +if errorlevel 1 (exit /b 1) + exit /b 0 \ No newline at end of file diff --git a/source/python/README.md b/source/python/README.md index 36a8bb13..b64197ae 100644 --- a/source/python/README.md +++ b/source/python/README.md @@ -32,7 +32,7 @@ Example --- -### GeoMoon(time:astronomy.Time) -> astronomy.Vector +### GeoMoon(time: astronomy.Time) -> astronomy.Vector Calculates the geocentric position of the Moon at a given time. Given a time of observation, calculates the Moon's position as a vector.