From: Ingo Ruhnke Date: Fri, 20 Nov 2009 03:33:58 +0000 (+0000) Subject: Moved obstackpp.hpp to util/ X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=5c24ecd33799f22426ca83b46f39335adf03befc;p=supertux.git Moved obstackpp.hpp to util/ SVN-Revision: 6065 --- diff --git a/src/lisp/parser.cpp b/src/lisp/parser.cpp index 232cfc099..86609a67a 100644 --- a/src/lisp/parser.cpp +++ b/src/lisp/parser.cpp @@ -20,7 +20,7 @@ #include "lisp/lisp.hpp" #include "lisp/parser.hpp" -#include "obstack/obstackpp.hpp" +#include "util/obstackpp.hpp" #include "physfs/ifile_stream.hpp" #include "physfs/ifile_streambuf.hpp" #include "supertux/globals.hpp" diff --git a/src/obstack/obstackpp.hpp b/src/obstack/obstackpp.hpp deleted file mode 100644 index e73a247eb..000000000 --- a/src/obstack/obstackpp.hpp +++ /dev/null @@ -1,47 +0,0 @@ -// SuperTux -// Copyright (C) 2007 Matthias Braun -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#ifndef HEADER_SUPERTUX_OBSTACK_OBSTACKPP_HPP -#define HEADER_SUPERTUX_OBSTACK_OBSTACKPP_HPP - -#include - -inline void* -operator new (size_t bytes, struct obstack& obst) -{ - return obstack_alloc(&obst, bytes); -} - -inline void* -operator new[] (size_t bytes, struct obstack& obst) -{ - return obstack_alloc(&obst, bytes); -} - -static inline void* obstack_chunk_alloc(size_t size) -{ - return new char[size]; -} - -static inline void obstack_chunk_free(void* data) -{ - char* ptr = static_cast (data); - delete[] ptr; -} - -#endif - -/* EOF */ diff --git a/src/util/obstackpp.hpp b/src/util/obstackpp.hpp new file mode 100644 index 000000000..e73a247eb --- /dev/null +++ b/src/util/obstackpp.hpp @@ -0,0 +1,47 @@ +// SuperTux +// Copyright (C) 2007 Matthias Braun +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#ifndef HEADER_SUPERTUX_OBSTACK_OBSTACKPP_HPP +#define HEADER_SUPERTUX_OBSTACK_OBSTACKPP_HPP + +#include + +inline void* +operator new (size_t bytes, struct obstack& obst) +{ + return obstack_alloc(&obst, bytes); +} + +inline void* +operator new[] (size_t bytes, struct obstack& obst) +{ + return obstack_alloc(&obst, bytes); +} + +static inline void* obstack_chunk_alloc(size_t size) +{ + return new char[size]; +} + +static inline void obstack_chunk_free(void* data) +{ + char* ptr = static_cast (data); + delete[] ptr; +} + +#endif + +/* EOF */ diff --git a/src/video/drawing_context.cpp b/src/video/drawing_context.cpp index 070cffbb0..d94ab64d4 100644 --- a/src/video/drawing_context.cpp +++ b/src/video/drawing_context.cpp @@ -19,9 +19,9 @@ #include "video/drawing_context.hpp" -#include "obstack/obstackpp.hpp" #include "supertux/gameconfig.hpp" #include "supertux/globals.hpp" +#include "util/obstackpp.hpp" #include "video/drawing_request.hpp" #include "video/lightmap.hpp" #include "video/renderer.hpp" diff --git a/src/video/gl/gl_lightmap.cpp b/src/video/gl/gl_lightmap.cpp index 120aae608..4db7d0d19 100644 --- a/src/video/gl/gl_lightmap.cpp +++ b/src/video/gl/gl_lightmap.cpp @@ -26,16 +26,16 @@ #include #include -#include "obstack/obstackpp.hpp" #include "supertux/gameconfig.hpp" #include "supertux/globals.hpp" -#include "video/lightmap.hpp" +#include "util/obstackpp.hpp" #include "video/drawing_context.hpp" #include "video/drawing_request.hpp" #include "video/font.hpp" #include "video/gl/gl_surface_data.hpp" #include "video/gl/gl_texture.hpp" #include "video/glutil.hpp" +#include "video/lightmap.hpp" #include "video/renderer.hpp" #include "video/surface.hpp" #include "video/texture_manager.hpp"