Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into axis-ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Feb 8, 2020
2 parents 8a2959d + b24899d commit 3f4f589
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
# Some tests depend on this configuration.
test/data/bpf/bundle1 text eol=lf
test/data/bpf/bundle2 text eol=lf
apps/pdal-config text eol=lf
apps/pdal-config.in text eol=lf
23 changes: 4 additions & 19 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,9 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pdal.pc
DESTINATION "${PDAL_LIB_INSTALL_DIR}/pkgconfig/"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)

# Autoconf compatibility variables to use the same script source.
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pdal-config.in"
"${CMAKE_CURRENT_SOURCE_DIR}/pdal-config" @ONLY)

file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/pdal-config"
DESTINATION
"${PDAL_OUTPUT_BIN_DIR}/"
FILE_PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)

"${PDAL_OUTPUT_BIN_DIR}/pdal-config" @ONLY
NEWLINE_STYLE UNIX)
install(PROGRAMS "${PDAL_OUTPUT_BIN_DIR}/pdal-config"
DESTINATION
"${CMAKE_INSTALL_PREFIX}/bin"
Expand All @@ -89,15 +81,8 @@ install(PROGRAMS "${PDAL_OUTPUT_BIN_DIR}/pdal-config"
if(WIN32)
# Autoconf compatibility variables to use the same script source.
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pdal-config-bat.in"
"${CMAKE_CURRENT_SOURCE_DIR}/pdal-config.bat" @ONLY)

file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/pdal-config.bat"
DESTINATION
"${PDAL_OUTPUT_BIN_DIR}/"
FILE_PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)

"${PDAL_OUTPUT_BIN_DIR}/pdal-config.bat" @ONLY
NEWLINE_STYLE CRLF)
install(PROGRAMS "${PDAL_OUTPUT_BIN_DIR}/pdal-config.bat"
DESTINATION
"${CMAKE_INSTALL_PREFIX}/bin"
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ jobs:
- template: ./scripts/azp/linux-conda.yml
- template: ./scripts/azp/win.yml
- template: ./scripts/azp/osx.yml
- template: ./scripts/azp/doc.yml
8 changes: 4 additions & 4 deletions io/LasHeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,19 @@ bool LasHeader::valid() const

void LasHeader::get(ILeStream& in, Uuid& uuid)
{
std::vector<char> buf(uuid.size);
std::vector<char> buf(uuid.size());

in.get(buf.data(), uuid.size);
in.get(buf.data(), uuid.size());
uuid.unpack(buf.data());
}


void LasHeader::put(OLeStream& out, Uuid uuid)
{
char buf[uuid.size];
char buf[uuid.size()];

uuid.pack(buf);
out.put(buf, uuid.size);
out.put(buf, uuid.size());
}


Expand Down
26 changes: 12 additions & 14 deletions pdal/util/Uuid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@

#include <cstdint>
#include <string>
#include <iomanip>

#include "pdal_util_export.hpp"

Expand Down Expand Up @@ -163,16 +164,17 @@ class PDAL_DLL Uuid

std::string unparse() const
{
std::vector<char> buf(36 + 1);
const char fmt[] = "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X";

// TODO: use snprintf after switch to C++11
sprintf(buf.data(), fmt,
m_data.time_low, m_data.time_mid, m_data.time_hi_and_version,
m_data.clock_seq >> 8, m_data.clock_seq & 0xFF,
m_data.node[0], m_data.node[1], m_data.node[2],
m_data.node[3], m_data.node[4], m_data.node[5]);
return std::string(buf.data());
std::stringstream out;

out << std::hex << std::uppercase << std::setfill('0');
out << std::setw(8) << m_data.time_low << '-';
out << std::setw(4) << m_data.time_mid << '-';
out << std::setw(4) << m_data.time_hi_and_version << '-';
out << std::setw(2) << (m_data.clock_seq >> 8);
out << std::setw(2) << (m_data.clock_seq & 0xFF) << '-';
for (size_t i = 0; i < 6; ++i)
out << std::setw(2) << (int)m_data.node[i];
return out.str();
}

std::string toString() const
Expand All @@ -190,12 +192,8 @@ class PDAL_DLL Uuid
return true;
}

/**
// Sadly, MS doesn't do constexpr.
static constexpr size_t size()
{ return sizeof(m_data); }
**/
static const int size = sizeof(uuid);

private:
uuid m_data;
Expand Down
10 changes: 5 additions & 5 deletions plugins/e57/libE57Format/src/CheckedFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void CheckedFile::read(char* buf, size_t nRead, size_t /*bufSize*/)
vector<char> page_buffer_v( physicalPageSize );
char* page_buffer = &page_buffer_v[0];

auto checksumMod = static_cast<const unsigned int>( std::nearbyint( 100.0 / checkSumPolicy_ ) );
auto checksumMod = static_cast<unsigned int>( std::nearbyint( 100.0 / checkSumPolicy_ ) );

while ( nRead > 0 )
{
Expand Down Expand Up @@ -240,7 +240,7 @@ void CheckedFile::write(const char* buf, size_t nWrite)
{
const off_t physicalLength = length( Physical );

if ( page*physicalPageSize < physicalLength )
if ( (off_t)(page*physicalPageSize) < physicalLength )
{
readPhysicalPage( page_buffer, page );
}
Expand Down Expand Up @@ -481,7 +481,7 @@ void CheckedFile::extend(off_t newLength, OffsetMode omode)
/// Watch out for different int sizes here.
size_t n = 0;

if (nWrite < logicalPageSize - pageOffset)
if (nWrite < (off_t)(logicalPageSize - pageOffset))
{
n = static_cast<size_t>(nWrite);
}
Expand All @@ -498,7 +498,7 @@ void CheckedFile::extend(off_t newLength, OffsetMode omode)
{
const off_t physicalLength = length( Physical );

if ( page*physicalPageSize < physicalLength )
if ( (off_t)(page*physicalPageSize) < physicalLength )
{
readPhysicalPage( page_buffer, page );
}
Expand All @@ -513,7 +513,7 @@ void CheckedFile::extend(off_t newLength, OffsetMode omode)
pageOffset = 0;
++page;

if (nWrite < logicalPageSize)
if (nWrite < (off_t)logicalPageSize)
{
n = static_cast<size_t>(nWrite);
}
Expand Down
39 changes: 39 additions & 0 deletions scripts/azp/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- mode: yaml -*-

jobs:
- job: docs
variables:
- group: aws-credentials
pool:
vmImage: ubuntu-16.04
container:
image: osgeo/proj-docs:latest
options: --privileged
timeoutInMinutes: 60
steps:
- script: |
echo "current directory:" `pwd`
cd doc
make doxygen
displayName: 'Make Doxygen'
- script: |
cd doc
make html
displayName: 'Make HTML'
- script: |
cd doc
make latexpdf
displayName: 'Make PDF'
- script: |
#export AWS_ACCESS_KEY_ID = variables['aws-credentials.AWS_ACCESS_KEY_ID']
#export AWS_SECRET_ACCESS_KEY = variables['aws-credentials.AWS_SECRET_ACCESS_KEY']
export AWS_ACCESS_KEY_ID="$(AWS_ACCESS_KEY_ID)"
export AWS_SECRET_ACCESS_KEY="$(AWS_SECRET_ACCESS_KEY)"
cd doc/build
aws s3 sync html "s3://pdal/docs/$(Build.SourceVersion)/html/" --acl public-read --quiet
aws s3 cp latex/PDAL.pdf "s3://pdal/docs/$(Build.SourceVersion)/html/" --acl public-read --quiet
echo "PDF location: https://pdal.s3.amazonaws.com/docs/$(Build.SourceVersion)/html/PDAL.pdf"
echo "HTML location: https://pdal.s3.amazonaws.com/docs/$(Build.SourceVersion)/html/index.html"
displayName: 'Upload https://pdal.s3.amazonaws.com/docs/$(Build.SourceVersion)/html/index.html'
condition: in(variables['Build.Reason'], 'PullRequest')
3 changes: 2 additions & 1 deletion scripts/azp/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
ECHO ON
call activate pdal
call conda config --set always_yes True --set show_channel_urls True
call conda install --yes --quiet --name pdal -c conda-forge geotiff laszip nitro curl gdal cmake eigen ninja libgdal zstd numpy xz libxml2 laz-perf qhull sqlite hdf5 tiledb conda-build ninja -y
call conda install --yes --quiet --name pdal -c conda-forge conda-build ninja -y
call conda install -c conda-forge pdal --only-deps -y
displayName: Install PDAL dependencies
- script: |
ECHO ON
Expand Down
4 changes: 2 additions & 2 deletions tools/lasdump/Header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ namespace
{
void get(ILeStream& in, Uuid& uuid)
{
std::vector<char> buf(uuid.size);
std::vector<char> buf(uuid.size());

in.get(buf.data(), uuid.size);
in.get(buf.data(), uuid.size());
uuid.unpack(buf.data());
}

Expand Down

0 comments on commit 3f4f589

Please sign in to comment.