summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2012-08-28 10:50:32 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2012-08-28 10:50:32 +0200
commit52b4fc986f65813618c238d0f96ddfecba70fce5 (patch)
tree716a3d94923757328ed96f47e1b8f041f52ff482
parent2b1fa4da96dc498af7d83e6189ef3876da137ffd (diff)
Try to use the stdint types only when really necessary
-rw-r--r--src/lib/ListInfo.h6
-rw-r--r--src/lib/MSPUBParser.cpp21
2 files changed, 10 insertions, 17 deletions
diff --git a/src/lib/ListInfo.h b/src/lib/ListInfo.h
index 359ce00..b6691c9 100644
--- a/src/lib/ListInfo.h
+++ b/src/lib/ListInfo.h
@@ -35,8 +35,6 @@
#include "NumberingType.h"
#include "NumberingDelimiter.h"
-using boost::uint32_t;
-
namespace libmspub
{
enum ListType
@@ -49,8 +47,8 @@ struct ListInfo
ListType m_listType;
//unordered list stuff
- boost::optional<uint32_t> m_bulletChar;
- ListInfo(uint32_t bulletChar) : m_listType(UNORDERED),
+ boost::optional<unsigned> m_bulletChar;
+ ListInfo(unsigned bulletChar) : m_listType(UNORDERED),
m_bulletChar(bulletChar), m_numberIfRestarted(),
m_numberingType(), m_numberingDelimiter()
{
diff --git a/src/lib/MSPUBParser.cpp b/src/lib/MSPUBParser.cpp
index 4889264..e7e3d46 100644
--- a/src/lib/MSPUBParser.cpp
+++ b/src/lib/MSPUBParser.cpp
@@ -52,11 +52,6 @@
#include "TableInfo.h"
#include "VerticalAlign.h"
-#if !defined(_MSC_VER) && !defined(BOOST_CSTDINT_HPP)
-using boost::int32_t;
-#endif
-using boost::uint32_t;
-
libmspub::MSPUBParser::MSPUBParser(WPXInputStream *input, MSPUBCollector *collector)
: m_input(input), m_collector(collector),
m_blockInfo(), m_contentChunks(),
@@ -1153,7 +1148,7 @@ libmspub::ParagraphStyle libmspub::MSPUBParser::getParagraphStyle(WPXInputStream
ParagraphStyle ret;
bool isList = false;
- uint32_t bulletChar = 0;
+ unsigned bulletChar = 0;
NumberingType numberingType = STANDARD_WESTERN;
NumberingDelimiter numberingDelimiter = NO_DELIMITER;
boost::optional<unsigned> numberIfRestarted;
@@ -1988,7 +1983,7 @@ std::vector<libmspub::Vertex> libmspub::MSPUBParser::parseVertices(
{
break;
}
- int32_t x, y;
+ int x, y;
switch (entrySize)
{
case 2:
@@ -1996,14 +1991,14 @@ std::vector<libmspub::Vertex> libmspub::MSPUBParser::parseVertices(
y = vertexData[offset + 1];
break;
case 4:
- x = vertexData[offset] | (uint32_t(vertexData[offset + 1]) << 8);
- y = vertexData[offset + 2] | (uint32_t(vertexData[offset + 3]) << 8);
+ x = vertexData[offset] | (unsigned(vertexData[offset + 1]) << 8);
+ y = vertexData[offset + 2] | (unsigned(vertexData[offset + 3]) << 8);
break;
case 8:
- x = vertexData[offset] | (uint32_t(vertexData[offset + 1]) << 8) |
- (uint32_t(vertexData[offset + 2]) << 16) | (uint32_t(vertexData[offset + 3]) << 24);
- y = vertexData[offset + 4] | (uint32_t(vertexData[offset + 5]) << 8) |
- (uint32_t(vertexData[offset + 6]) << 16) | (uint32_t(vertexData[offset + 7]) << 24);
+ x = vertexData[offset] | (unsigned(vertexData[offset + 1]) << 8) |
+ (unsigned(vertexData[offset + 2]) << 16) | (unsigned(vertexData[offset + 3]) << 24);
+ y = vertexData[offset + 4] | (unsigned(vertexData[offset + 5]) << 8) |
+ (unsigned(vertexData[offset + 6]) << 16) | (unsigned(vertexData[offset + 7]) << 24);
break;
default: // logically shouldn't be able to get here.
x = 0;