Skip to content

Commit

Permalink
Misc header correction
Browse files Browse the repository at this point in the history
  • Loading branch information
kunaltyagi committed Mar 23, 2020
1 parent 8405524 commit c38b56b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
15 changes: 8 additions & 7 deletions io/include/pcl/io/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@
* POSSIBILITY OF SUCH DAMAGE.
*
*/

#pragma once

#include <chrono>
#pragma once

#include <pcl/pcl_config.h>
#include <pcl/pcl_exports.h>
#include <pcl/io/boost.h>

#include <pcl/io/image_metadata_wrapper.h>
#include <pcl/memory.h>
#include <pcl/pcl_config.h>
#include <pcl/pcl_macros.h>

#include <chrono>

namespace pcl
{
namespace io
{
{

/**
* @brief Image interface class providing an interface to fill a RGB or Grayscale image buffer.
Expand Down Expand Up @@ -212,3 +212,4 @@ namespace pcl

} // namespace
}

24 changes: 13 additions & 11 deletions io/src/lzf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2000-2010 Marc Alexander Lehmann <schmorp@schmorp.de>
* Copyright (c) 2010-2011, Willow Garage, Inc.
*
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand All @@ -17,7 +17,7 @@
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
Expand All @@ -35,11 +35,13 @@
*
*/

#include <pcl/io/lzf.h>
#include <cstring>
#include <climits>
#include <pcl/console/print.h>
#include <pcl/io/lzf.h>

#include <cerrno>
#include <climits>
#include <cstddef>
#include <cstring>

/*
* Size of hashtable is (1 << HLOG) * sizeof (char *)
Expand Down Expand Up @@ -114,7 +116,7 @@ pcl::lzfCompress (const void *const in_data, unsigned int in_len,

hval = (hval << 8) | ip[2];
hslot = htab + IDX (hval);
const unsigned char *ref = *hslot + (static_cast<const unsigned char*> (in_data));
const unsigned char *ref = *hslot + (static_cast<const unsigned char*> (in_data));
*hslot = static_cast<unsigned int> (ip - (static_cast<const unsigned char*> (in_data)));

// off requires a type wide enough to hold a general pointer difference.
Expand All @@ -125,14 +127,14 @@ pcl::lzfCompress (const void *const in_data, unsigned int in_len,
// special workaround for it.
#if defined (WIN32) && defined (_M_X64) && defined (_MSC_VER)
// workaround for missing POSIX compliance
unsigned _int64 off;
unsigned _int64 off;
#else
unsigned long off;
#endif

if (
// The next test will actually take care of this, but this is faster if htab is initialized
ref < ip
ref < ip
&& (off = ip - ref - 1) < (1 << 13)
&& ref > static_cast<const unsigned char *> (in_data)
&& ref[2] == ip[2]
Expand All @@ -145,7 +147,7 @@ pcl::lzfCompress (const void *const in_data, unsigned int in_len,
{
// Match found at *ref++
unsigned int len = 2;
ptrdiff_t maxlen = in_end - ip - len;
std::ptrdiff_t maxlen = in_end - ip - len;
maxlen = maxlen > ((1 << 8) + (1 << 3)) ? ((1 << 8) + (1 << 3)) : maxlen;

// First a faster conservative test
Expand Down Expand Up @@ -248,7 +250,7 @@ pcl::lzfCompress (const void *const in_data, unsigned int in_len,
}
}

// At most 3 bytes can be missing here
// At most 3 bytes can be missing here
if (op + 3 > out_end)
return (0);

Expand All @@ -274,7 +276,7 @@ pcl::lzfCompress (const void *const in_data, unsigned int in_len,
}

///////////////////////////////////////////////////////////////////////////////////////////
unsigned int
unsigned int
pcl::lzfDecompress (const void *const in_data, unsigned int in_len,
void *out_data, unsigned int out_len)
{
Expand Down
2 changes: 1 addition & 1 deletion octree/include/pcl/octree/octree_key.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class OctreeKey {
{}

/** \brief Copy constructor. */
OctreeKey(const OctreeKey& source) { memcpy(key_, source.key_, sizeof(key_)); }
OctreeKey(const OctreeKey& source) { std::memcpy(key_, source.key_, sizeof(key_)); }

OctreeKey&
operator=(const OctreeKey&) = default;
Expand Down

0 comments on commit c38b56b

Please sign in to comment.