diff --git a/Makefile b/Makefile index ffcf525..6738034 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ SIMPLESOCKETS=ext/powerblog/ext/simplesocket/swrappers.o ext/powerblog/ext/simpl navparse: navparse.o ext/fmt-5.2.1/src/format.o $(H2OPP) $(SIMPLESOCKETS) minicurl.o ubx.o bits.o navmon.pb.o gps.o $(CXX) -std=gnu++17 $^ -o $@ -pthread -L/usr/local/lib -lh2o-evloop -lssl -lcrypto -lz -lcurl -lprotobuf # -lwslay -navdump: navdump.o ext/fmt-5.2.1/src/format.o bits.o navmon.pb.o +navdump: navdump.o ext/fmt-5.2.1/src/format.o bits.o navmon.pb.o gps.o $(CXX) -std=gnu++17 $^ -o $@ -pthread -lprotobuf diff --git a/ephemeris.hh b/ephemeris.hh index fd207cd..7f38e2a 100644 --- a/ephemeris.hh +++ b/ephemeris.hh @@ -1,13 +1,14 @@ #pragma once #include "minivec.hh" -void getCoordinates(int wn, double tow, const auto& iod, Point* p, bool quiet=true) +template +void getCoordinates(int wn, double tow, T& iod, Point* p, bool quiet=true) { using namespace std; // here goes - constexpr double mu = 3.986004418 * pow(10.0, 14.0); - constexpr double omegaE = 7.2921151467 * pow(10.0, -5); + const double mu = 3.986004418 * pow(10.0, 14.0); + const double omegaE = 7.2921151467 * pow(10.0, -5); double sqrtA = 1.0*iod.sqrtA / (1ULL<<19); double deltan = M_PI * 1.0*iod.deltan / (1LL<<43); diff --git a/navdump.cc b/navdump.cc index 78154fb..e49a753 100644 --- a/navdump.cc +++ b/navdump.cc @@ -22,7 +22,7 @@ using namespace std; static std::string humanTime(time_t t) { - struct tm tm; + struct tm tm={0}; gmtime_r(&t, &tm); char buffer[80]; @@ -67,7 +67,10 @@ int main(int argc, char** argv) uint8_t page; int frame=parseGPSMessage(cond, gs, &page); cout<<"GPS "<