Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 7 additions & 3 deletions src/qball/Base64Transcoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ Base64Transcoder::Base64Transcoder()
}

////////////////////////////////////////////////////////////////////////////////
int Base64Transcoder::encode(int nbytes, const byte* const from, char* const to)
int Base64Transcoder::encode(int nbytes, const ::byte* const from, char* const to)
{
using ::byte;

const byte* fptr = from;
char* tptr = to;

Expand Down Expand Up @@ -122,15 +124,17 @@ int Base64Transcoder::encode(int nbytes, const byte* const from, char* const to)

////////////////////////////////////////////////////////////////////////////////
int Base64Transcoder::decode(const int nchars, const char* const from,
byte* const to)
::byte* const to)
{
// Decode Base64 chars in array "from" into bytes in array "to"
// White space and new lines are skipped
// extra characters at end that do not form a valid group of 4 chars are
// ignored.
// nchars: number of chars in array "from"
// the number of bytes successfully translated is returned


using ::byte;

byte a0,a1,a2,a3,b0,b1,b2,b3;
int c;
const char* fptr = from;
Expand Down
6 changes: 3 additions & 3 deletions src/qball/Base64Transcoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ typedef unsigned char byte;
class Base64Transcoder
{
char etable[64]; // encode table
byte dtable[256]; // decode table
::byte dtable[256]; // decode table

public:

Base64Transcoder();
int encode(int nbytes, const byte* const from, char* const to);
int decode(int nchars, const char* const from, byte* const to);
int encode(int nbytes, const ::byte* const from, char* const to);
int decode(int nchars, const char* const from, ::byte* const to);
void byteswap_double(size_t n, double* const x);
void byteswap_int(size_t n, int* const x);
int print(int nchars, const char* const buf, ostream& o);
Expand Down
4 changes: 2 additions & 2 deletions src/qball/SlaterDet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2886,7 +2886,7 @@ void SlaterDet::print(ostream& os, string encoding) {
int outlen = xcdr.nchars(nbytes);
char* b = new char[outlen];
assert(b!=0);
xcdr.encode(nbytes,(byte*) &wftmpr[0],b);
xcdr.encode(nbytes,(::byte*) &wftmpr[0],b);
// Note: optional x0,y0,z0 attributes not used, default is zero
os << "<grid_function type=\"double\""
<< " nx=\"" << ft.np0()
Expand Down Expand Up @@ -3146,7 +3146,7 @@ void SlaterDet::write(SharedFilePtr& sfp, string encoding, double weight, int is
int outlen = xcdr.nchars(nbytes);
char* b = new char[outlen];
assert(b!=0);
xcdr.encode(nbytes,(byte*) &tmpr[0],b);
xcdr.encode(nbytes,(::byte*) &tmpr[0],b);
// Note: optional x0,y0,z0 attributes not used, default is zero
if ( ctxt_.myrow() == 0 )
{
Expand Down