Skip to content

Commit

Permalink
Updates to gist for building with g++ on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Oct 30, 2023
1 parent c36e99b commit fb3de71
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/gtools/gist/PerspectiveGatherer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ renderPerspective(RenderingFace face, Options& opt, std::string component, std::
bu_log("ERROR: failed to run: %s\n", render.c_str());
bu_exit(BRLCAD_ERROR, "system() failed\n");
}
} catch (std::exception& e) {
std::cerr << e.what() << std::endl;
} catch (std::exception& er) {
std::cerr << er.what() << std::endl;
}

if (!bu_file_exists(outputname.c_str(), NULL)) {
Expand Down
6 changes: 4 additions & 2 deletions src/gtools/gist/RenderHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include "RenderHandler.h"


LayoutChoice::LayoutChoice(std::string map, bool lockRows)
: map(map), lockRows(lockRows), coordinates(), dimDetails()
LayoutChoice::LayoutChoice(std::string l_map, bool l_lockRows)
: map(l_map), lockRows(l_lockRows), coordinates(), dimDetails()
{
// make a vector to store coordinates of each item on the map AND ALSO the ambient occlusion view
for (size_t i = 0; i < map.size() + 1; ++i)
Expand Down Expand Up @@ -188,6 +188,7 @@ LayoutChoice::initCoordinates(int secWidth, int secHeight, double modelLength, d
continue;
case '\n': case ' ': case 'A':
std::cerr << "ISSUE: Found unexpected character!" << std::endl;
/* fallthrough */
default:
ModelDimension dim = faceDetails[map[ambientR * rowLen + i]].widthContributor;

Expand All @@ -209,6 +210,7 @@ LayoutChoice::initCoordinates(int secWidth, int secHeight, double modelLength, d
continue;
case '\n': case ' ': case 'A':
std::cerr << "ISSUE: Found unexpected character!" << std::endl;
/* fallthrough */
default:
ModelDimension dim = faceDetails[map[i * rowLen + ambientC]].heightContributor;

Expand Down
28 changes: 14 additions & 14 deletions src/gtools/gist/picohash.h
Original file line number Diff line number Diff line change
Expand Up @@ -645,9 +645,9 @@ inline void picohash_init_md5(picohash_ctx_t *ctx)
{
ctx->block_length = PICOHASH_MD5_BLOCK_LENGTH;
ctx->digest_length = PICOHASH_MD5_DIGEST_LENGTH;
ctx->_reset = reinterpret_cast<void (__cdecl *)(void *)>(_picohash_md5_init);
ctx->_update = reinterpret_cast<void (__cdecl *)(void *, const void *, size_t)>(_picohash_md5_update);
ctx->_final = reinterpret_cast<void (__cdecl *)(void *, void *)>(_picohash_md5_final);
ctx->_reset = reinterpret_cast<void (*)(void*)>(_picohash_md5_init);
ctx->_update = reinterpret_cast<void (*)(void*, const void*, size_t)>(_picohash_md5_update);
ctx->_final = reinterpret_cast<void (*)(void*, void*)>(_picohash_md5_final);

_picohash_md5_init(&ctx->_md5);
}
Expand All @@ -656,29 +656,29 @@ inline void picohash_init_sha1(picohash_ctx_t *ctx)
{
ctx->block_length = PICOHASH_SHA1_BLOCK_LENGTH;
ctx->digest_length = PICOHASH_SHA1_DIGEST_LENGTH;
ctx->_reset = reinterpret_cast<void(__cdecl*)(void*)>(_picohash_sha1_init);
ctx->_update = reinterpret_cast<void(__cdecl*)(void*, const void*, size_t)>(_picohash_sha1_update);
ctx->_final = reinterpret_cast<void(__cdecl*)(void*, void*)>(_picohash_sha1_final);
ctx->_reset = reinterpret_cast<void (*)(void*)>(_picohash_sha1_init);
ctx->_update = reinterpret_cast<void (*)(void*, const void*, size_t)>(_picohash_sha1_update);
ctx->_final = reinterpret_cast<void (*)(void*, void*)>(_picohash_sha1_final);
_picohash_sha1_init(&ctx->_sha1);
}

inline void picohash_init_sha224(picohash_ctx_t *ctx)
{
ctx->block_length = PICOHASH_SHA224_BLOCK_LENGTH;
ctx->digest_length = PICOHASH_SHA224_DIGEST_LENGTH;
ctx->_reset = reinterpret_cast<void(__cdecl*)(void*)>(_picohash_sha224_init);
ctx->_update = reinterpret_cast<void(__cdecl*)(void*, const void*, size_t)>(_picohash_sha256_update);
ctx->_final = reinterpret_cast<void(__cdecl*)(void*, void*)>(_picohash_sha224_final);
ctx->_reset = reinterpret_cast<void (*)(void*)>(_picohash_sha224_init);
ctx->_update = reinterpret_cast<void (*)(void*, const void*, size_t)>(_picohash_sha256_update);
ctx->_final = reinterpret_cast<void (*)(void*, void*)>(_picohash_sha224_final);
_picohash_sha224_init(&ctx->_sha256);
}

inline void picohash_init_sha256(picohash_ctx_t *ctx)
{
ctx->block_length = PICOHASH_SHA256_BLOCK_LENGTH;
ctx->digest_length = PICOHASH_SHA256_DIGEST_LENGTH;
ctx->_reset = reinterpret_cast<void(__cdecl*)(void*)>(_picohash_sha256_init);
ctx->_update = reinterpret_cast<void(__cdecl*)(void*, const void*, size_t)>(_picohash_sha256_update);
ctx->_final = reinterpret_cast<void(__cdecl*)(void*, void*)>(_picohash_sha256_final);
ctx->_reset = (void (*)(void*))_picohash_sha256_init;
ctx->_update = (void (*)(void*, const void*, size_t))_picohash_sha256_update;
ctx->_final = (void (*)(void*, void*))_picohash_sha256_final;
_picohash_sha256_init(&ctx->_sha256);
}

Expand Down Expand Up @@ -744,8 +744,8 @@ inline void picohash_init_hmac(picohash_ctx_t *ctx, void (*initf)(picohash_ctx_t
/* replace reset and final function */
ctx->_hmac.hash_reset = ctx->_reset;
ctx->_hmac.hash_final = ctx->_final;
ctx->_reset = reinterpret_cast<void(__cdecl*)(void*)>(_picohash_hmac_reset);
ctx->_final = reinterpret_cast<void(__cdecl*)(void*, void*)>(_picohash_hmac_final);
ctx->_reset = reinterpret_cast<void (*)(void*)>(_picohash_hmac_reset);
ctx->_final = reinterpret_cast<void (*)(void*, void*)>(_picohash_hmac_final);

/* start calculating the inner hash */
_picohash_hmac_apply_key(ctx, 0x36);
Expand Down

0 comments on commit fb3de71

Please sign in to comment.