Ver código fonte

patch

master
despair 4 anos atrás
pai
commit
a123c62bc4
2 arquivos alterados com 3 adições e 3 exclusões
  1. 2
    2
      src/CFGFileParser.cpp
  2. 1
    1
      src/pnm.cpp

+ 2
- 2
src/CFGFileParser.cpp Ver arquivo

@@ -9,7 +9,7 @@ CFGFileParser::CFGFileParser(const char* filename){
// the buffer, close the file
cfg_file = fopen(filename, "rb"); // On NT, opening in text mode translates \n into \r\n
stat(filename, cfg_fileinfo);
buffer = static_cast<char*>(tlsf_malloc(cfg_fileinfo->st_size & INT_MAX, sizeof(char) & INT_MAX));
buffer = static_cast<char*>(tlsf_malloc(cfg_fileinfo->st_size & INT_MAX));
cfg = new BrowserConfiguration();
bytesRead = fread(buffer, sizeof(char) & INT_MAX, cfg_fileinfo->st_size & INT_MAX, cfg_file);
if (!bytesRead) {
@@ -39,7 +39,7 @@ bool CFGFileParser::ParseText() {
size_t pass1_length = 0;
struct slre regex; // final validation before adding to second-pass buffer
// Second pass. All comments and .tags stripped out. Starts off at 512 bytes, increases if necessary.
char* directives = static_cast<char*>(tlsf_malloc(512, sizeof(char)));
char* directives = static_cast<char*>(tlsf_malloc(512));
char* tmp2;
token = strtok_r(buffer, "\n", &tmp);
while (tmp != nullptr) {

+ 1
- 1
src/pnm.cpp Ver arquivo

@@ -61,7 +61,7 @@ RGBAPNMObject * readPPM(const char* fileName) {
}

// allocate array for pixels
char* pixels = reinterpret_cast<char*>(tlsf_malloc(size, sizeof(char))); // used to be: new char[size];
char* pixels = reinterpret_cast<char*>(tlsf_malloc(size)); // used to be: new char[size];

// unformatted read of binary pixel data
res = fread(pixels, sizeof(int), size, fr);

Carregando…
Cancelar
Salvar