Skip to content

Commit

Permalink
Fix const correctness and add additional includes. Refs #229.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.nexusformat.org/code/trunk@1471 ff5d1e40-2be0-497f-93bd-dc18237bd3c7
  • Loading branch information
FreddieAkeroyd authored and Freddie Akeroyd committed May 9, 2010
1 parent e30c4c6 commit 15f9c52
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion contrib/applications/NXextract/src/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ int String::ExtractTokenRight(char cLeft, char cRight, String *pstrToken)
//---------------------------------------------------------------------------
// String::RemoveEnclosure
//---------------------------------------------------------------------------
bool String::RemoveEnclosure(psz pszLeft, psz pszRight)
bool String::RemoveEnclosure(pcsz pszLeft, pcsz pszRight)
{
// pcszLeft & pcszRight must have the same length
if( strlen(pszLeft) != strlen(pszRight) )
Expand Down
2 changes: 1 addition & 1 deletion contrib/applications/NXextract/src/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class String : public string
/// @param pcszLeft list of possible left enclosure chars
/// @param pcszRight list of possible right enclosure chars
/// @return true if enclosure was removed
bool RemoveEnclosure(psz pszLeft, psz pszRight);
bool RemoveEnclosure(pcsz pszLeft, pcsz pszRight);
bool RemoveEnclosure(char cLeft, char cRight);

/// Match string with mask containing '*' and '?' jokers
Expand Down
3 changes: 3 additions & 0 deletions contrib/applications/NXextract/src/bmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
//
//*****************************************************************************

#include <cstring>
#include <cstdlib>
#include <cstdio>
#include "base.h"
#include "file.h"
#include "membuf.h"
Expand Down
2 changes: 2 additions & 0 deletions contrib/applications/NXextract/src/extractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <fstream>
#include <sstream>
#include <vector>
#include <cstring>
#include <cstdlib>

#include "nexusevaluator.h"
#include "extractor.h"
Expand Down
2 changes: 2 additions & 0 deletions contrib/applications/NXextract/src/extractorapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <fstream>
#include <sstream>
#include <vector>
#include <cstdlib>
#include <cstring>

#include "nexusevaluator.h"
#include "extractor.h"
Expand Down
6 changes: 3 additions & 3 deletions contrib/applications/NXextract/src/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ void FileName::MkDir(mode_t mode, uid_t uid, gid_t gid) const
if( str.empty() )
return;

char *p;
const char *p;
#ifdef __WIN32__
// Skeep UNC starting if it exists
if( str[0u] == SEP_PATH && str[1u] == SEP_PATH )
Expand Down Expand Up @@ -574,7 +574,7 @@ void FileName::MkDir(mode_t mode, uid_t uid, gid_t gid) const

do
{
*p = 0;
str[p - PSZ(str)] = '\0'; // *p = 0;
struct stat st;
if( ::stat(PSZ(str), &st) )
{
Expand Down Expand Up @@ -633,7 +633,7 @@ void FileName::MkDir(mode_t mode, uid_t uid, gid_t gid) const
// Directory : ok
}
// Next path component
*p = SEP_PATH;
str[p - PSZ(str)] = SEP_PATH; // *p = SEP_PATH;
p = strchr(p+1, SEP_PATH);
} while( p );
}
Expand Down
3 changes: 3 additions & 0 deletions contrib/applications/NXextract/src/jpegwrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
//
//*****************************************************************************

#include <cstring>
#include <cstdlib>
#include <cstdio>
#include "base.h"
#include "file.h"
#include "membuf.h"
Expand Down
2 changes: 1 addition & 1 deletion contrib/applications/NXextract/src/membuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ CMemBuf& CMemBuf::operator<<(const CMemBuf& membuf)
//---------------------------------------------------------------------------
String CMemBuf::HexString() const
{
static char *pszHexa = "0123456789ABCDEF";
static const char *pszHexa = "0123456789ABCDEF";
ostringstream oss;
String str;
str.reserve(2 * m_uiLen);
Expand Down
4 changes: 3 additions & 1 deletion contrib/applications/NXextract/src/nexusevaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
#include "membuf.h"
#include "variant.h"

#include <sstream>
#include <cstdlib>
#include <cstring>
#include "nexusevaluator.h"
#include "extractor.h"
#include "templateparsor.h"
#include <sstream>

// special attributes
const char SIZE_ATTR[] = "_size_";
Expand Down
2 changes: 2 additions & 0 deletions contrib/applications/NXextract/src/templateparsor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <fstream>
#include <sstream>
#include <vector>
#include <cstring>
#include <cstdlib>

#include "nexusevaluator.h"
#include "extractor.h"
Expand Down

0 comments on commit 15f9c52

Please sign in to comment.