Skip to content

Commit

Permalink
Removed unneeded headers.
Browse files Browse the repository at this point in the history
Small cleanup
  • Loading branch information
jackburton79 committed Jan 15, 2025
1 parent 3c5733b commit 3bb1631
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 0 additions & 2 deletions support/SupportDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ typedef char int8;
typedef unsigned char uint8;
typedef signed char sint8;

#include <stdio.h>

#include <string>
#include <vector>

Expand Down
13 changes: 7 additions & 6 deletions support/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,22 @@

#include <iostream>


const char*
trim(char* string)
trim(const char* string)
{
while (isspace(*string))
string++;
char* newStringStart = const_cast<char*>(string);
while (isspace(*newStringStart))
newStringStart++;

ssize_t length = ::strlen(string);
char* endOfString = string + length - 1;
char* endOfString = newStringStart + ::strlen(newStringStart) - 1;
while (isspace(*endOfString))
endOfString--;

endOfString++;
*endOfString = '\0';

return string;
return newStringStart;
}


Expand Down
8 changes: 4 additions & 4 deletions support/Utils.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#ifndef __UTILS_H
#define __UTILS_H

#include <stdio.h>
#include <string>
#include <cstdio>

#include "SupportDefs.h"

// trims in place
const char* trim(char* string);
// Does not touch the passed string
const char* trim(const char* string);

// Replaces "\" to "/"
void path_dos_to_unix(char* path);

// Opens a file case insensitively on a case sensitive FS
Expand Down

0 comments on commit 3bb1631

Please sign in to comment.