Skip to content

Commit

Permalink
SetAl() argument int -> int64_t
Browse files Browse the repository at this point in the history
  • Loading branch information
kautlenbachs committed Oct 9, 2024
1 parent 4044425 commit 37f0f79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
4 changes: 2 additions & 2 deletions envisat_format/include/envisat_lvl1_mph.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ struct Lvl1MPH {

void SetSbt(const ASARMetadata& md) {
SetStr(utc_sbt_time, "UTC_SBT_TIME", PtimeToStr(md.utc_sbt_time));
SetAl64(sat_binary_time, "SAT_BINARY_TIME", md.sat_binary_time);
SetAl64(clock_step, "CLOCK_STEP", md.clock_step, "<ps>");
SetAl(sat_binary_time, "SAT_BINARY_TIME", md.sat_binary_time);
SetAl(clock_step, "CLOCK_STEP", md.clock_step, "<ps>");
}

void SetLeap(const ASARMetadata& md) {
Expand Down
20 changes: 2 additions & 18 deletions envisat_format/include/envisat_mph_sph_str_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,7 @@ inline std::string ToAs(int val) {
return buf;
}

inline std::string ToAl(int val) {
char buf[20];
snprintf(buf, 20, "%+011d", val); // Sign specifier counts as additional integer part count.
return buf;
}

inline std::string ToAl64(int64_t val) {
inline std::string ToAl(int64_t val) {
char buf[20];
snprintf(buf, 20, "%+011ld", val); // Sign specifier counts as additional integer part count.
return buf;
Expand Down Expand Up @@ -134,7 +128,7 @@ void SetAs(uc (&arr)[N], const char* keyword, int val, const char* unit = "") {
}

template <size_t N>
void SetAl(uc (&arr)[N], const char* keyword, int val, const char* unit = "") {
void SetAl(uc (&arr)[N], const char* keyword, int64_t val, const char* unit = "") {
std::string buf = keyword;
buf += "=";
buf += ToAl(val);
Expand All @@ -143,16 +137,6 @@ void SetAl(uc (&arr)[N], const char* keyword, int val, const char* unit = "") {
CopyStr(arr, buf);
}

template <size_t N>
void SetAl64(uc (&arr)[N], const char* keyword, int64_t val, const char* unit = "") {
std::string buf = keyword;
buf += "=";
buf += ToAl64(val);
buf += unit;
buf += '\n';
CopyStr(arr, buf);
}

template <size_t N>
void SetAc(uc (&arr)[N], const char* keyword, int val, const char* unit = "") {
std::string buf = keyword;
Expand Down

0 comments on commit 37f0f79

Please sign in to comment.