summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-06-19 18:06:14 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-06-19 18:06:14 +0000
commit44134f448d7d96f21751c55defab6ef8a32afab8 (patch)
tree99af7559e7332a50b18c66febe6882f7408da835
parent7b419ad9ecc9ff3056102a265a141863e168cd14 (diff)
Fixed SNC warnings
git-svn-id: http://pugixml.googlecode.com/svn/trunk@525 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r--src/pugixml.cpp78
-rw-r--r--src/pugixpath.cpp4
2 files changed, 46 insertions, 36 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index 3f871f1..51b7791 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -47,6 +47,10 @@
# pragma warn -8066 // unreachable code
#endif
+#ifdef __SNC__
+# pragma diag_suppress=178 // function waS declared but never referenced
+#endif
+
// uintptr_t
#if !defined(_MSC_VER) || _MSC_VER >= 1600
# include <stdint.h>
@@ -309,42 +313,7 @@ namespace pugi
global_deallocate(page->memory);
}
- PUGIXML_NO_INLINE void* allocate_memory_oob(size_t size, xml_memory_page*& out_page)
- {
- const size_t large_allocation_threshold = xml_memory_page_size / 4;
-
- xml_memory_page* page = allocate_page(size <= large_allocation_threshold ? xml_memory_page_size : size);
- if (!page) return 0;
-
- if (size <= large_allocation_threshold)
- {
- _root->busy_size = _busy_size;
-
- // insert page at the end of linked list
- page->prev = _root;
- _root->next = page;
- _root = page;
-
- _busy_size = size;
- }
- else
- {
- // insert page before the end of linked list
- assert(_root->prev);
-
- page->prev = _root->prev;
- page->next = _root;
-
- _root->prev->next = page;
- _root->prev = page;
- }
-
- // allocate inside page
- page->busy_size = size;
-
- out_page = page;
- return page->data;
- }
+ void* allocate_memory_oob(size_t size, xml_memory_page*& out_page);
void* allocate_memory(size_t size, xml_memory_page*& out_page)
{
@@ -427,6 +396,43 @@ namespace pugi
size_t _busy_size;
};
+ PUGIXML_NO_INLINE void* xml_allocator::allocate_memory_oob(size_t size, xml_memory_page*& out_page)
+ {
+ const size_t large_allocation_threshold = xml_memory_page_size / 4;
+
+ xml_memory_page* page = allocate_page(size <= large_allocation_threshold ? xml_memory_page_size : size);
+ if (!page) return 0;
+
+ if (size <= large_allocation_threshold)
+ {
+ _root->busy_size = _busy_size;
+
+ // insert page at the end of linked list
+ page->prev = _root;
+ _root->next = page;
+ _root = page;
+
+ _busy_size = size;
+ }
+ else
+ {
+ // insert page before the end of linked list
+ assert(_root->prev);
+
+ page->prev = _root->prev;
+ page->next = _root;
+
+ _root->prev->next = page;
+ _root->prev = page;
+ }
+
+ // allocate inside page
+ page->busy_size = size;
+
+ out_page = page;
+ return page->data;
+ }
+
/// A 'name=value' XML attribute structure.
struct xml_attribute_struct
{
diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp
index dfc5637..17674fb 100644
--- a/src/pugixpath.cpp
+++ b/src/pugixpath.cpp
@@ -44,6 +44,10 @@ typedef __int32 int32_t;
# pragma warning(disable: 4127) // conditional expression is constant
#endif
+#ifdef __SNC__
+# pragma diag_suppress=237 // controlling expression is constant
+#endif
+
#include <algorithm>
#include <string>