c++
* use nullptr instead of NULL
This commit is contained in:
@@ -28,7 +28,7 @@ public:
|
||||
}
|
||||
|
||||
int width, height;
|
||||
emscripten_get_canvas_size(&width, &height, NULL);
|
||||
emscripten_get_canvas_size(&width, &height, nullptr);
|
||||
|
||||
glfwSetMousePosCallback(mousemove);
|
||||
glfwSetMouseButtonCallback(mouseclick);
|
||||
|
||||
@@ -42,7 +42,7 @@ private:
|
||||
|
||||
// For debug reasons, we're storing the bind information so that we can
|
||||
// detect errors and report
|
||||
void *buffer_ptr = NULL;
|
||||
void *buffer_ptr = nullptr;
|
||||
char *offset_ptr = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <memory>
|
||||
|
||||
#ifndef BUFFER_OFFSET
|
||||
#define BUFFER_OFFSET(i) ((char *)NULL + (i))
|
||||
#define BUFFER_OFFSET(i) ((char *)nullptr + (i))
|
||||
#endif
|
||||
|
||||
namespace llmr {
|
||||
|
||||
@@ -46,8 +46,8 @@ struct pbf {
|
||||
inline void skipValue(uint32_t val);
|
||||
inline void skipBytes(uint32_t bytes);
|
||||
|
||||
const uint8_t *data = NULL;
|
||||
const uint8_t *end = NULL;
|
||||
const uint8_t *data = nullptr;
|
||||
const uint8_t *end = nullptr;
|
||||
uint32_t value = 0;
|
||||
uint32_t tag = 0;
|
||||
};
|
||||
@@ -60,8 +60,8 @@ pbf::pbf(const unsigned char *data, uint32_t length)
|
||||
}
|
||||
|
||||
pbf::pbf()
|
||||
: data(NULL),
|
||||
end(NULL),
|
||||
: data(nullptr),
|
||||
end(nullptr),
|
||||
value(0),
|
||||
tag(0) {
|
||||
}
|
||||
@@ -185,4 +185,3 @@ void pbf::skipBytes(uint32_t bytes) {
|
||||
} // end namespace llmr
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ int8_t simplex_93[] = { 5, 25, 7, 24, 8, 23, 9, 21, 9, 19, 8, 17, 7, 16, 6, 14,
|
||||
int8_t simplex_94[] = { 3, 6, 3, 8, 4, 11, 6, 12, 8, 12, 10, 11, 14, 8, 16, 7, 18, 7, 20, 8, 21, 10, -1, -1, 3, 8, 4, 10, 6, 11, 8, 11, 10, 10, 14, 7, 16, 6, 18, 6, 20, 7, 21, 10, 21, 12 };
|
||||
|
||||
struct glyph {
|
||||
glyph() : width(0), length(0), data(NULL) { }
|
||||
glyph() : width(0), length(0), data(nullptr) { }
|
||||
glyph(uint8_t width, uint8_t length, int8_t *data)
|
||||
: width(width),
|
||||
length(length),
|
||||
@@ -110,7 +110,7 @@ struct glyph {
|
||||
// Font data From Hershey Simplex Font
|
||||
// http://paulbourke.net/dataformats/hershey/
|
||||
std::map<char, glyph> simplex = {
|
||||
{ ' ', { 16, 0, NULL } },
|
||||
{ ' ', { 16, 0, nullptr } },
|
||||
{ '!', { 10, sizeof(simplex_1), simplex_1 } },
|
||||
{ '"', { 16, sizeof(simplex_2), simplex_2 } },
|
||||
{ '#', { 21, sizeof(simplex_3), simplex_3 } },
|
||||
|
||||
@@ -77,7 +77,7 @@ void Tile::request() {
|
||||
}
|
||||
}, []() {
|
||||
// TODO: Make sure this gets passed the correct map ID/pointer.
|
||||
platform::restart(NULL);
|
||||
platform::restart(nullptr);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ std::shared_ptr<Bucket> Tile::createBucket(const VectorTile& tile, const BucketD
|
||||
// The layer specified in the bucket does not exist. Do nothing.
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<Bucket> Tile::createFillBucket(const VectorTileLayer& layer, const BucketDescription& bucket_desc) {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <llmr/util/math.hpp>
|
||||
#include <llmr/platform/gl.hpp>
|
||||
|
||||
#define BUFFER_OFFSET(i) ((char *)NULL + (i))
|
||||
#define BUFFER_OFFSET(i) ((char *)nullptr + (i))
|
||||
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
using namespace llmr;
|
||||
|
||||
#define BUFFER_OFFSET(i) ((char *)NULL + (i))
|
||||
#define BUFFER_OFFSET(i) ((char *)nullptr + (i))
|
||||
|
||||
Painter::Painter(Transform& transform, Settings& settings, Style& style)
|
||||
: transform(transform),
|
||||
|
||||
@@ -129,7 +129,7 @@ void Sprite::loadImage(const std::string& data) {
|
||||
return;
|
||||
}
|
||||
|
||||
png_structp png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, errorHandler, warningHandler);
|
||||
png_structp png = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, errorHandler, warningHandler);
|
||||
assert(png);
|
||||
|
||||
png_infop info = png_create_info_struct(png);
|
||||
@@ -140,7 +140,7 @@ void Sprite::loadImage(const std::string& data) {
|
||||
try {
|
||||
png_set_read_fn(png, (png_voidp)&buffer, readCallback);
|
||||
png_read_info(png, info);
|
||||
png_get_IHDR(png, info, (png_uint_32*)&width, (png_uint_32*)&height, &depth, &color, &interlace, NULL, NULL);
|
||||
png_get_IHDR(png, info, (png_uint_32*)&width, (png_uint_32*)&height, &depth, &color, &interlace, nullptr, nullptr);
|
||||
bool alpha = (color & PNG_COLOR_MASK_ALPHA) || png_get_valid(png, info, PNG_INFO_tRNS);
|
||||
|
||||
// From http://trac.mapnik.org/browser/trunk/src/png_reader.cpp
|
||||
@@ -187,10 +187,10 @@ void Sprite::loadImage(const std::string& data) {
|
||||
// Read image data
|
||||
png_read_image(png, row_pointers);
|
||||
|
||||
png_read_end(png, NULL);
|
||||
png_read_end(png, nullptr);
|
||||
} catch (std::exception& e) {
|
||||
fprintf(stderr, "loading PNG failed: %s\n", e.what());
|
||||
png_destroy_read_struct(&png, &info, NULL);
|
||||
png_destroy_read_struct(&png, &info, nullptr);
|
||||
img.clear();
|
||||
width = 0;
|
||||
height = 0;
|
||||
|
||||
Reference in New Issue
Block a user