aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-03-21 22:58:01 +0000
committerdos-reis <gdr@axiomatics.org>2011-03-21 22:58:01 +0000
commit7dc19cbfb3fef1f70794d2baaebd183d21b7d6b0 (patch)
tree4951f977a0579e88906ff2b19ee98ccdd557c428 /src/utils
parentdfadd6b270f0238ef2f5e54fac780b6a6951ee4b (diff)
downloadopen-axiom-7dc19cbfb3fef1f70794d2baaebd183d21b7d6b0.tar.gz
Fix some type detection issues
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/sexpr.cc1
-rw-r--r--src/utils/string-pool.H13
-rw-r--r--src/utils/string-pool.cc8
3 files changed, 13 insertions, 9 deletions
diff --git a/src/utils/sexpr.cc b/src/utils/sexpr.cc
index 69dc7b72..9e57765f 100644
--- a/src/utils/sexpr.cc
+++ b/src/utils/sexpr.cc
@@ -32,6 +32,7 @@
// --% Author: Gabriel Dos Reis.
#include <ctype.h>
+#include <string.h>
#include <iostream>
#include <iterator>
#include <open-axiom/sexpr>
diff --git a/src/utils/string-pool.H b/src/utils/string-pool.H
index ae90409b..311db1bf 100644
--- a/src/utils/string-pool.H
+++ b/src/utils/string-pool.H
@@ -1,4 +1,4 @@
-// Copyright (C) 2010, Gabriel Dos Reis.
+// Copyright (C) 2010-2011, Gabriel Dos Reis.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,6 @@
#ifndef OPENAXIOM_STRING_POOL_INCLUDED
#define OPENAXIOM_STRING_POOL_INCLUDED
-#include <string.h>
#include <open-axiom/hash-table>
// --% Author: Gabriel Dos Reis.
@@ -62,17 +61,15 @@ namespace OpenAxiom {
// ----------------
// -- StringPool --
// ----------------
- // A stringpool object is a repository of long-living string objects.
- // It contains no duplicates, therefore allowing fast string
- // object comparison for equality.
+ // A string-pool object is a repository of long-living string objects.
+ // It contains no duplicates, therefore allows fast equality
+ // comparison of string objects.
struct StringPool : private BasicHashTable<StringItem> {
using BasicHashTable<StringItem>::EntryType;
StringPool();
// Intern a NUL-terminated sequence of characters.
- EntryType* intern(const char* s) {
- return intern(s, strlen(s));
- }
+ EntryType* intern(const char*);
// Intern a sequence of characters given by its start and length.
EntryType* intern(const char*, size_t);
diff --git a/src/utils/string-pool.cc b/src/utils/string-pool.cc
index 0c529ace..db5036a0 100644
--- a/src/utils/string-pool.cc
+++ b/src/utils/string-pool.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2010, Gabriel Dos Reis.
+// Copyright (C) 2010-2011, Gabriel Dos Reis.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -31,6 +31,7 @@
// --% Author: Gabriel Dos Reis
+#include <string.h>
#include <open-axiom/string-pool>
namespace OpenAxiom {
@@ -93,4 +94,9 @@ namespace OpenAxiom {
e->hash = h;
return e;
}
+
+ StringPool::EntryType*
+ StringPool::intern(const char* s) {
+ return intern(s, strlen(s));
+ }
}