Skip to content

Commit

Permalink
update node-gyp and reduce compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
keel committed Dec 1, 2018
1 parent 5cb8655 commit 4109f4c
Show file tree
Hide file tree
Showing 11 changed files with 329 additions and 329 deletions.
6 changes: 3 additions & 3 deletions deps/swisseph/swehel.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static double OpticFactor(double Bback, double kX, double *dobs, double JDNDaysU
double OpticDia = dobs[4];
double OpticTrans = dobs[5];
AS_BOOL is_scotopic = FALSE;
JDNDaysUT = JDNDaysUT; /* currently not used, statement prevents compiler warning */
//JDNDaysUT = JDNDaysUT; /* currently not used, statement prevents compiler warning */
SNi = SN;
if (SNi <= 0.00000001) SNi = 0.00000001;
/* 23 jaar as standard from Garstang*/
Expand Down Expand Up @@ -553,7 +553,7 @@ static double SunRA(double JDNDaysUT, int32 helflag, char *serr)
double dut;
static TLS double tjdlast;
static TLS double ralast;
helflag = helflag; /* statement prevents compiler warning */
//helflag = helflag; /* statement prevents compiler warning */
*serr = '\0';
if (JDNDaysUT == tjdlast)
return ralast;
Expand Down Expand Up @@ -1265,7 +1265,7 @@ static double Bday(double AltO, double AziO, double AltS, double AziS, double su
static double Bcity(double Value, double Press)
{
double Bcity = Value;
Press = Press; /* unused; statement prevents compiler warning */
//Press = Press; /* unused; statement prevents compiler warning */
Bcity = mymax(Bcity, 0);
return Bcity;
}
Expand Down
2 changes: 1 addition & 1 deletion deps/swisseph/sweph.c
Original file line number Diff line number Diff line change
Expand Up @@ -6524,7 +6524,7 @@ static int32 search_star_in_list(char *sstar, struct fixed_star *stardata, char
} else if (!is_bayer && (sp = strchr(sstar, '%')) != NULL) {
stardatabegp = &(swed.fixed_stars[swed.n_fixstars_real]);
ndata = swed.n_fixstars_named;
if (sp - sstar != strlen(sstar) - 1) {
if (sp - sstar != (unsigned)(strlen(sstar) - 1)) {
if (serr != NULL)
sprintf(serr, "error, swe_fixstar(): invalid search string %s", sstar);
return ERR;
Expand Down
2 changes: 1 addition & 1 deletion deps/swisseph/swephlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ static void owen_pre_matrix(double tjd, double *rp, int iflag)
oma += (k[i] * owen_oma_coef[icof][i]);
chia += (k[i] * owen_chia_coef[icof][i]);
}
if (iflag & (SEFLG_JPLHOR || SEFLG_JPLHOR_APPROX)) {
if (iflag & (SEFLG_JPLHOR | SEFLG_JPLHOR_APPROX)) {
/*
* In comparison with JPL Horizons we have an almost constant offset
* almost constant offset in ecl. longitude of about -0.000019 deg.
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "mivion",
"name": "swisseph",
"description": "Swiss Ephemeris binding for node.js",
"version": "0.5.8",
"version": "0.5.9",
"homepage": "http://github.com/mivion/swisseph",
"repository": {
"url": "http://github.com/mivion/swisseph.git"
Expand All @@ -15,9 +15,9 @@
"astronomy"
],
"dependencies": {
"merge": "^1.2.x",
"nan": "^2.1.x",
"node-gyp": "3.0.x",
"merge": "^1.2.x"
"node-gyp": "^3.8.0"
},
"devDependencies": {},
"optionalDependencies": {},
Expand Down
62 changes: 31 additions & 31 deletions src/date.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ NAN_METHOD(node_swe_date_conversion) {
!info [1]->IsNumber () ||
!info [2]->IsNumber () ||
!info [3]->IsNumber () ||
(!info [4]->IsString () && info [4]->ToString ()->Length () > 0)
(!info [4]->IsString () && info [4]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local<v8::String>())->Length () > 0)
) {
Nan::ThrowTypeError ("Wrong type of arguments");
};
Expand All @@ -33,11 +33,11 @@ NAN_METHOD(node_swe_date_conversion) {
Local <Object> result = Nan::New<Object> ();

rflag = ::swe_date_conversion (
(int)info [0]->NumberValue (),
(int)info [1]->NumberValue (),
(int)info [2]->NumberValue (),
info [3]->NumberValue (),
(* String::Utf8Value (info [4]->ToString ())) [0],
(int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(* String::Utf8Value (Isolate::GetCurrent(), info [4]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local<v8::String>()))) [0],
&tjd
);

Expand Down Expand Up @@ -74,11 +74,11 @@ NAN_METHOD(node_swe_julday) {
};

Local <Number> result = Nan::New<Number> (::swe_julday (
(int)info [0]->NumberValue (),
(int)info [1]->NumberValue (),
(int)info [2]->NumberValue (),
info [3]->NumberValue (),
(int)info [4]->NumberValue ()
(int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked()
));

HandleCallback (info, result);
Expand Down Expand Up @@ -115,8 +115,8 @@ NAN_METHOD(node_swe_revjul) {
Local <Object> result = Nan::New<Object> ();

::swe_revjul (
info [0]->NumberValue (),
(int)info [1]->NumberValue (),
info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
&year, &month, &day, &hour
);

Expand Down Expand Up @@ -164,13 +164,13 @@ NAN_METHOD(node_swe_utc_to_jd) {
Local <Object> result = Nan::New<Object> ();

rflag = ::swe_utc_to_jd (
(int)info [0]->NumberValue (),
(int)info [1]->NumberValue (),
(int)info [2]->NumberValue (),
(int)info [3]->NumberValue (),
(int)info [4]->NumberValue (),
info [5]->NumberValue (),
(int)info [6]->NumberValue (),
(int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [6]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
tjd, serr
);

Expand Down Expand Up @@ -217,8 +217,8 @@ NAN_METHOD(node_swe_jdet_to_utc) {
Local <Object> result = Nan::New<Object> ();

::swe_jdet_to_utc (
info [0]->NumberValue (),
(int)info [1]->NumberValue (),
info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
&year, &month, &day, &hour, &minute, &second
);

Expand Down Expand Up @@ -265,8 +265,8 @@ NAN_METHOD(node_swe_jdut1_to_utc) {
Local <Object> result = Nan::New<Object> ();

::swe_jdut1_to_utc (
info [0]->NumberValue (),
(int)info [1]->NumberValue (),
info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
&year, &month, &day, &hour, &minute, &second
);

Expand Down Expand Up @@ -318,13 +318,13 @@ NAN_METHOD(node_swe_utc_time_zone) {
Local <Object> result = Nan::New<Object> ();

::swe_utc_time_zone (
(int)info [0]->NumberValue (),
(int)info [1]->NumberValue (),
(int)info [2]->NumberValue (),
(int)info [3]->NumberValue (),
(int)info [4]->NumberValue (),
info [5]->NumberValue (),
info [6]->NumberValue (),
(int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
(int)info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
info [6]->NumberValue (Nan::GetCurrentContext()).ToChecked(),
&year, &month, &day, &hour, &minute, &second
);

Expand Down
Loading

0 comments on commit 4109f4c

Please sign in to comment.