From 7dc19cbfb3fef1f70794d2baaebd183d21b7d6b0 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Mon, 21 Mar 2011 22:58:01 +0000 Subject: Fix some type detection issues --- src/utils/sexpr.cc | 1 + src/utils/string-pool.H | 13 +++++-------- src/utils/string-pool.cc | 8 +++++++- 3 files changed, 13 insertions(+), 9 deletions(-) (limited to 'src/utils') 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 +#include #include #include #include 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 #include // --% 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 { using BasicHashTable::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 #include 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)); + } } -- cgit v1.2.3