From d61ff449105e6cf84351e68939670f31998c090e Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 25 Jun 2016 18:49:39 -0500 Subject: [PATCH] Cleaned up std includes because std is no longer private to fs. --- src/ox/fs/filestore.hpp | 3 +-- src/ox/fs/filesystem.hpp | 4 +--- src/ox/fs/test/filestoreio.cpp | 2 +- src/ox/std/CMakeLists.txt | 10 +++++---- src/ox/std/memops.cpp | 29 ++++++++++++++++++++++++++ src/ox/std/{_memops.hpp => memops.hpp} | 0 src/ox/std/std.hpp | 12 +++++++++++ src/ox/std/{_strops.cpp => strops.cpp} | 0 src/ox/std/{_strops.hpp => strops.hpp} | 0 src/ox/std/{_types.hpp => types.hpp} | 0 10 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 src/ox/std/memops.cpp rename src/ox/std/{_memops.hpp => memops.hpp} (100%) create mode 100644 src/ox/std/std.hpp rename src/ox/std/{_strops.cpp => strops.cpp} (100%) rename src/ox/std/{_strops.hpp => strops.hpp} (100%) rename src/ox/std/{_types.hpp => types.hpp} (100%) diff --git a/src/ox/fs/filestore.hpp b/src/ox/fs/filestore.hpp index c92fbb8e6..9a7c6e454 100644 --- a/src/ox/fs/filestore.hpp +++ b/src/ox/fs/filestore.hpp @@ -7,8 +7,7 @@ */ #pragma once -#include -#include +#include namespace ox { namespace fs { diff --git a/src/ox/fs/filesystem.hpp b/src/ox/fs/filesystem.hpp index b505868ff..6e9a49e39 100644 --- a/src/ox/fs/filesystem.hpp +++ b/src/ox/fs/filesystem.hpp @@ -7,9 +7,7 @@ */ #pragma once -#include -#include -#include +#include #include "filestore.hpp" namespace ox { diff --git a/src/ox/fs/test/filestoreio.cpp b/src/ox/fs/test/filestoreio.cpp index 60f3c2dab..f5a31e2f2 100644 --- a/src/ox/fs/test/filestoreio.cpp +++ b/src/ox/fs/test/filestoreio.cpp @@ -5,7 +5,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include +#include #include using namespace ox::fs; diff --git a/src/ox/std/CMakeLists.txt b/src/ox/std/CMakeLists.txt index 7ca6648eb..efb6250b8 100644 --- a/src/ox/std/CMakeLists.txt +++ b/src/ox/std/CMakeLists.txt @@ -2,14 +2,16 @@ cmake_minimum_required(VERSION 2.8) add_library( OxStd - _memops.cpp - _strops.cpp + memops.cpp + strops.cpp ) install( FILES - _memops.hpp - _strops.hpp + memops.hpp + strops.hpp + std.hpp + types.hpp DESTINATION include/ox/std ) diff --git a/src/ox/std/memops.cpp b/src/ox/std/memops.cpp new file mode 100644 index 000000000..6c2e3c701 --- /dev/null +++ b/src/ox/std/memops.cpp @@ -0,0 +1,29 @@ +/* + * Copyright 2015 - 2016 gtalent2@gmail.com + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include "memops.hpp" + +namespace ox { +namespace std { + +void memcpy(void *dest, void *src, int size) { + char *srcBuf = (char*) src; + char *dstBuf = (char*) dest; + for (int i = 0; i < size; i++) { + dstBuf[i] = (char) srcBuf[i]; + } +} + +void memset(void *ptr, char val, int size) { + char *buf = (char*) ptr; + for (int i = 0; i < size; i++) { + buf[i] = val; + } +} + +} +} diff --git a/src/ox/std/_memops.hpp b/src/ox/std/memops.hpp similarity index 100% rename from src/ox/std/_memops.hpp rename to src/ox/std/memops.hpp diff --git a/src/ox/std/std.hpp b/src/ox/std/std.hpp new file mode 100644 index 000000000..0c8ddedbd --- /dev/null +++ b/src/ox/std/std.hpp @@ -0,0 +1,12 @@ +/* + * Copyright 2015 - 2016 gtalent2@gmail.com + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#pragma once + +#include "memops.hpp" +#include "strops.hpp" +#include "types.hpp" diff --git a/src/ox/std/_strops.cpp b/src/ox/std/strops.cpp similarity index 100% rename from src/ox/std/_strops.cpp rename to src/ox/std/strops.cpp diff --git a/src/ox/std/_strops.hpp b/src/ox/std/strops.hpp similarity index 100% rename from src/ox/std/_strops.hpp rename to src/ox/std/strops.hpp diff --git a/src/ox/std/_types.hpp b/src/ox/std/types.hpp similarity index 100% rename from src/ox/std/_types.hpp rename to src/ox/std/types.hpp