Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extraneous output in shapelib and fix a truncated string #51

Merged
merged 5 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
nits
  • Loading branch information
sahrkm committed Feb 20, 2022
commit 573e7c904b9a615fcf3bc1a08f1da724caa2273b
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.

All changes are by Kevin Sahr, unless otherwise noted.

## [7.52] - 2022-02-19
### Added
- support for dggridR output
### Changed
- minor refactor of macro FALLTHROUGH to suppress clang compiler warning

## [7.51] - 2022-02-12
### Added
- macro FALLTHROUGH to suppress compiler warning on implict switch case fallthrough
Expand Down
6 changes: 3 additions & 3 deletions src/lib/dglib/include/dglib/DgBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ using namespace std;
// adapted from stackoverflow user Pierre
#define WHERE fprintf(stderr,"[LOG]%s:%s#%d\n",__PRETTY_FUNCTION__,__FILE__,__LINE__);
// macro for intentional switch statement fallthrough
#if defined(__GNUC__) && __GNUC__ >= 7 || defined(__clang__) && __clang_major__ >= 12
#define FALLTHROUGH __attribute__ ((fallthrough));
#else
#if __has_cpp_attribute(fallthrough)
#define FALLTHROUGH [[fallthrough]];
#else
#if defined(__GNUC__) && __GNUC__ >= 7 || defined(__clang__) && __clang_major__ >= 12
#define FALLTHROUGH __attribute__ ((fallthrough))
#else
#define FALLTHROUGH
#endif
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/lib/dglib/include/dglib/DgConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ constexpr long double M_EPSILON = 0.00000000000050000000000000000000000000000L
constexpr long double M_ZERO = 0.00000000000000000000000000000000000000000L;
constexpr long double M_ONE = 1.00000000000000000000000000000000000000000L;
constexpr long double M_HALF = 0.50000000000000000000000000000000000000000L;
constexpr long double M_2PI = 6.28318530717958647692528676655900576839433L;
//constexpr long double M_2PI = 6.28318530717958647692528676655900576839433L;
constexpr long double M_SQRT3 = 1.7320508075688772935274463415058723669428L;
constexpr long double M_1_SQRT3 = 0.5773502691896257645091487805019574556476L;
constexpr long double M_SQRT3_2 = 0.8660254037844386467637231707529361834714L;
Expand Down
7 changes: 5 additions & 2 deletions src/lib/dglib/lib/DgOutShapefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ DgOutShapefile::writeDbf (const string& id)
int fNum = DBFGetFieldIndex(dbFile_, it->fieldName().c_str());
bool res = false;
//cout << "writing " << fNum << " " << it->fieldName() << " ";
switch (it->type())
{
switch (it->type()) {
case FTString:
//cout << defStrAttribute() << endl;
res = DBFWriteStringAttribute(dbFile_, recNum_, fNum, defStrAttribute().c_str());
Expand All @@ -247,6 +246,10 @@ DgOutShapefile::writeDbf (const string& id)
::report("DgOutShapefile::writeDbf() invalid field",
failLevel());
break;
default:
::report("DgOutShapefile::writeDbf() unexpected field type",
failLevel());
break;
}

if (!res)
Expand Down