Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Oliver Behnke
graphicsframework
Commits
d6b8f9f3
Commit
d6b8f9f3
authored
May 27, 2009
by
Oliver Bock
Browse files
Ensure 64 bit compatibility
parent
b9739aa3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/orc/ResourceCompiler.cpp
View file @
d6b8f9f3
...
...
@@ -45,7 +45,7 @@ void ResourceCompiler::compile()
map
<
string
,
vector
<
unsigned
char
>
>::
iterator
mapPos
;
vector
<
unsigned
char
>::
iterator
dataPos
;
unsigned
in
t
currentIndex
=
0
;
size_
t
currentIndex
=
0
;
// store total amount of resources
resourceIndexInitializer
<<
"{0x"
<<
hex
<<
m_ResourceDataMap
.
size
()
<<
", 0x0},"
;
...
...
@@ -64,7 +64,7 @@ void ResourceCompiler::compile()
// iterate over the data content byte by byte
for
(
dataPos
=
mapPos
->
second
.
begin
();
dataPos
!=
mapPos
->
second
.
end
();
++
dataPos
)
{
// store byte value as part of array initializer
resourceStorageInitializer
<<
"0x"
<<
hex
<<
(
in
t
)
*
dataPos
<<
","
;
resourceStorageInitializer
<<
"0x"
<<
hex
<<
(
size_
t
)
*
dataPos
<<
","
;
}
}
...
...
@@ -89,7 +89,7 @@ void ResourceCompiler::compile()
outputFile
<<
endl
<<
"};"
<<
endl
<<
endl
;
output
=
resourceIndexInitializer
.
str
();
outputFile
<<
"extern const unsigned
in
t c_ResourceIndex[][2] = {"
<<
endl
;
outputFile
<<
"extern const unsigned
size_
t c_ResourceIndex[][2] = {"
<<
endl
;
outputFile
<<
output
.
substr
(
0
,
output
.
length
()
-
1
);
outputFile
<<
endl
<<
"};"
<<
endl
<<
endl
;
...
...
@@ -124,13 +124,13 @@ void ResourceCompiler::parseInputFile()
// read input file line by line
while
(
getline
(
inputFile
,
line
))
{
unsigned
in
t
firstCharacter
=
line
.
find_first_not_of
(
"
\t\r\n\f
"
);
size_
t
firstCharacter
=
line
.
find_first_not_of
(
"
\t\r\n\f
"
);
// we (sort of) allow for empty lines and comments
if
(
firstCharacter
!=
string
::
npos
&&
line
.
substr
(
firstCharacter
,
1
)
!=
"#"
)
{
// find our token delimiter
unsigned
in
t
separator
=
line
.
find
(
"|"
);
size_
t
separator
=
line
.
find
(
"|"
);
// make sure there's exactly one delimiter
if
(
separator
==
string
::
npos
||
separator
!=
line
.
rfind
(
"|"
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment