From 2b8ff3bf3844e20ba8021f1f40c3e59f64b69772 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 10 May 2016 09:27:29 +0200 Subject: [PATCH] Move cpu_features to libretro-common --- Makefile.common | 2 +- audio/audio_dsp_filter.c | 2 +- audio/audio_resampler_driver.c | 2 +- audio/audio_utils.c | 3 +- dynamic.c | 2 +- gfx/video_driver.c | 2 +- gfx/video_filter.c | 2 +- gfx/video_thread_wrapper.c | 2 +- griffin/griffin.c | 2 +- .../features/cpu_features.c | 40 +++++++++---------- libretro-common/formats/jpeg/rjpeg.c | 22 ++++++++++ .../include/features/cpu_features.h | 30 ++++++++------ libretro-common/include/formats/image.h | 30 ++++++++------ libretro-common/include/formats/jsonsax.h | 2 +- libretro-common/include/formats/rjpeg.h | 2 +- libretro-common/include/formats/rpng.h | 2 +- libretro-common/include/formats/rxml.h | 2 +- menu/drivers/menu_generic.c | 3 +- menu/menu_animation.c | 3 +- menu/menu_input.c | 3 +- network/net_http_special.c | 2 +- performance_counters.c | 3 +- retroarch.c | 2 +- runloop.c | 2 +- 24 files changed, 102 insertions(+), 65 deletions(-) rename performance.c => libretro-common/features/cpu_features.c (91%) rename performance.h => libretro-common/include/features/cpu_features.h (56%) diff --git a/Makefile.common b/Makefile.common index 9a55a67774..98e9683fc0 100644 --- a/Makefile.common +++ b/Makefile.common @@ -204,7 +204,7 @@ OBJ += frontend/frontend.o \ movie.o \ record/record_driver.o \ record/drivers/record_null.o \ - performance.o \ + libretro-common/features/cpu_features.o \ performance_counters.o \ verbosity.o diff --git a/audio/audio_dsp_filter.c b/audio/audio_dsp_filter.c index e781683918..1d206e2a5f 100644 --- a/audio/audio_dsp_filter.c +++ b/audio/audio_dsp_filter.c @@ -23,13 +23,13 @@ #include #include +#include #include "audio_dsp_filter.h" #include "audio_filters/dspfilter.h" #include "../config_file_userdata.h" #include "../frontend/frontend_driver.h" -#include "../performance.h" #include "../performance_counters.h" #include "../dynamic.h" diff --git a/audio/audio_resampler_driver.c b/audio/audio_resampler_driver.c index a50d70fece..9487afed5b 100644 --- a/audio/audio_resampler_driver.c +++ b/audio/audio_resampler_driver.c @@ -17,11 +17,11 @@ #include #include +#include #include "audio_resampler_driver.h" #include "../config_file_userdata.h" #ifdef RARCH_INTERNAL -#include "../performance.h" #include "../performance_counters.h" #endif #ifndef DONT_HAVE_STRING_LIST diff --git a/audio/audio_utils.c b/audio/audio_utils.c index 51b5f9b9a1..64b7df19ec 100644 --- a/audio/audio_utils.c +++ b/audio/audio_utils.c @@ -23,8 +23,9 @@ #include #endif +#include + #ifdef RARCH_INTERNAL -#include "../performance.h" #include "../performance_counters.h" #endif diff --git a/dynamic.c b/dynamic.c index e89bdfa18d..e8cf340371 100644 --- a/dynamic.c +++ b/dynamic.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #ifdef HAVE_CONFIG_H @@ -38,7 +39,6 @@ #include "record/record_driver.h" #include "core.h" #include "performance_counters.h" -#include "performance.h" #include "system.h" #include "gfx/video_context_driver.h" diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 8b380a7dc4..dc66557d6b 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -25,6 +25,7 @@ #endif #include +#include #include "video_thread_wrapper.h" #include "../frontend/frontend_driver.h" @@ -33,7 +34,6 @@ #include "../config.def.h" #include "../retroarch.h" #include "../runloop.h" -#include "../performance.h" #include "../performance_counters.h" #include "../list_special.h" #include "../core.h" diff --git a/gfx/video_filter.c b/gfx/video_filter.c index fe46697bce..6cc8a2be7a 100644 --- a/gfx/video_filter.c +++ b/gfx/video_filter.c @@ -19,12 +19,12 @@ #include #include #include +#include #include "../frontend/frontend_driver.h" #include "../config_file_userdata.h" #include "../dynamic.h" #include "../general.h" -#include "../performance.h" #include "../performance_counters.h" #include "../verbosity.h" #include "video_filter.h" diff --git a/gfx/video_thread_wrapper.c b/gfx/video_thread_wrapper.c index b4b8ca1155..bbfc87d8fd 100644 --- a/gfx/video_thread_wrapper.c +++ b/gfx/video_thread_wrapper.c @@ -19,11 +19,11 @@ #include #include +#include #include "video_thread_wrapper.h" #include "font_driver.h" #include "video_shader_driver.h" -#include "../performance.h" #include "../performance_counters.h" #include "../runloop.h" #include "../verbosity.h" diff --git a/griffin/griffin.c b/griffin/griffin.c index e483a0c10c..735ea2f1fe 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -62,7 +62,7 @@ ENCODINGS /*============================================================ PERFORMANCE ============================================================ */ -#include "../performance.c" +#include "../libretro-common/features/cpu_features.c" #include "../performance_counters.c" /*============================================================ diff --git a/performance.c b/libretro-common/features/cpu_features.c similarity index 91% rename from performance.c rename to libretro-common/features/cpu_features.c index b165192103..94f5b73e79 100644 --- a/performance.c +++ b/libretro-common/features/cpu_features.c @@ -1,31 +1,29 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2016 - Daniel De Matteis +/* Copyright (C) 2010-2016 The RetroArch team * - * RetroArch 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 Found- - * ation, either version 3 of the License, or (at your option) any later version. + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (cpu_features.c). + * --------------------------------------------------------------------------------------- * - * RetroArch 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. + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include -#include "libretro.h" -#include "performance.h" -#include "general.h" -#include "compat/strl.h" -#include "verbosity.h" -#ifdef _WIN32 -#define PERF_LOG_FMT "[PERF]: Avg (%s): %I64u ticks, %I64u runs.\n" -#else -#define PERF_LOG_FMT "[PERF]: Avg (%s): %llu ticks, %llu runs.\n" -#endif +#include +#include #if defined(_WIN32) #include diff --git a/libretro-common/formats/jpeg/rjpeg.c b/libretro-common/formats/jpeg/rjpeg.c index 4d43a66c76..e8e6f2701d 100644 --- a/libretro-common/formats/jpeg/rjpeg.c +++ b/libretro-common/formats/jpeg/rjpeg.c @@ -1,3 +1,25 @@ +/* Copyright (C) 2010-2016 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (rjpeg.c). + * --------------------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + /* Modified version of stb_image's JPEG sources. */ diff --git a/performance.h b/libretro-common/include/features/cpu_features.h similarity index 56% rename from performance.h rename to libretro-common/include/features/cpu_features.h index dac242511d..dc8d091188 100644 --- a/performance.h +++ b/libretro-common/include/features/cpu_features.h @@ -1,17 +1,23 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2016 - Daniel De Matteis - * - * RetroArch 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 Found- - * ation, either version 3 of the License, or (at your option) any later version. +/* Copyright (C) 2010-2016 The RetroArch team * - * RetroArch 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. + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (cpu_features.h). + * --------------------------------------------------------------------------------------- * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef _LIBRETRO_SDK_CPU_INFO_H diff --git a/libretro-common/include/formats/image.h b/libretro-common/include/formats/image.h index 1f96b81efd..00457cf2a5 100644 --- a/libretro-common/include/formats/image.h +++ b/libretro-common/include/formats/image.h @@ -1,17 +1,23 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2015 - Daniel De Matteis - * - * RetroArch 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 Found- - * ation, either version 3 of the License, or (at your option) any later version. +/* Copyright (C) 2010-2016 The RetroArch team * - * RetroArch 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. + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (image.h). + * --------------------------------------------------------------------------------------- * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef __RARCH_IMAGE_CONTEXT_H diff --git a/libretro-common/include/formats/jsonsax.h b/libretro-common/include/formats/jsonsax.h index 76860fe5f5..86d6d6b207 100644 --- a/libretro-common/include/formats/jsonsax.h +++ b/libretro-common/include/formats/jsonsax.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2015 The RetroArch team +/* Copyright (C) 2010-2016 The RetroArch team * * --------------------------------------------------------------------------------------- * The following license statement only applies to this file (jsonsax.h). diff --git a/libretro-common/include/formats/rjpeg.h b/libretro-common/include/formats/rjpeg.h index 539fd058df..81f61b92af 100644 --- a/libretro-common/include/formats/rjpeg.h +++ b/libretro-common/include/formats/rjpeg.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2015 The RetroArch team +/* Copyright (C) 2010-2016 The RetroArch team * * --------------------------------------------------------------------------------------- * The following license statement only applies to this file (rjpeg.h). diff --git a/libretro-common/include/formats/rpng.h b/libretro-common/include/formats/rpng.h index 94db62932f..fa3f5d5bca 100644 --- a/libretro-common/include/formats/rpng.h +++ b/libretro-common/include/formats/rpng.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2015 The RetroArch team +/* Copyright (C) 2010-2016 The RetroArch team * * --------------------------------------------------------------------------------------- * The following license statement only applies to this file (rpng.h). diff --git a/libretro-common/include/formats/rxml.h b/libretro-common/include/formats/rxml.h index 3ee1109601..c3f3335c19 100644 --- a/libretro-common/include/formats/rxml.h +++ b/libretro-common/include/formats/rxml.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2015 The RetroArch team +/* Copyright (C) 2010-2016 The RetroArch team * * --------------------------------------------------------------------------------------- * The following license statement only applies to this file (rxml.h). diff --git a/menu/drivers/menu_generic.c b/menu/drivers/menu_generic.c index c1bd67114d..989d3b5727 100644 --- a/menu/drivers/menu_generic.c +++ b/menu/drivers/menu_generic.c @@ -18,6 +18,8 @@ #include #include +#include + #include "menu_generic.h" #include "../menu_driver.h" @@ -28,7 +30,6 @@ #include "../menu_entries.h" #include "../../configuration.h" -#include "../../performance.h" #include "../../performance_counters.h" #include "../../input/input_autodetect.h" #include "../../input/input_config.h" diff --git a/menu/menu_animation.c b/menu/menu_animation.c index db267ec8fb..a4c1efb0ce 100644 --- a/menu/menu_animation.c +++ b/menu/menu_animation.c @@ -16,13 +16,14 @@ #include #include + #include #include #include +#include #include "menu_animation.h" #include "../configuration.h" -#include "../performance.h" #include "../performance_counters.h" #define IDEAL_DELTA_TIME (1.0 / 60.0 * 1000000.0) diff --git a/menu/menu_input.c b/menu/menu_input.c index 0025dd668d..f1a5b66415 100644 --- a/menu/menu_input.c +++ b/menu/menu_input.c @@ -27,6 +27,8 @@ #include #include +#include + #include "menu_driver.h" #include "menu_input.h" #include "menu_animation.h" @@ -39,7 +41,6 @@ #include "../general.h" #include "../managers/cheat_manager.h" -#include "../performance.h" #include "../performance_counters.h" #include "../core.h" #include "../input/input_joypad_driver.h" diff --git a/network/net_http_special.c b/network/net_http_special.c index 2c488c614c..10ad9c15fe 100644 --- a/network/net_http_special.c +++ b/network/net_http_special.c @@ -17,8 +17,8 @@ #include #include +#include -#include "../performance.h" #include "../performance_counters.h" #include "net_http_special.h" diff --git a/performance_counters.c b/performance_counters.c index 209e6fb824..2ac7ee2a72 100644 --- a/performance_counters.c +++ b/performance_counters.c @@ -17,7 +17,8 @@ #include #include -#include "performance.h" +#include + #include "performance_counters.h" #include "general.h" diff --git a/retroarch.c b/retroarch.c index e0f1cff51f..70032242ec 100644 --- a/retroarch.c +++ b/retroarch.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "content.h" #include "core_type.h" @@ -58,7 +59,6 @@ #include "configuration.h" #include "general.h" #include "runloop.h" -#include "performance.h" #include "managers/cheat_manager.h" #include "system.h" diff --git a/runloop.c b/runloop.c index 63e4e2d889..03780d734b 100644 --- a/runloop.c +++ b/runloop.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #ifdef HAVE_THREADS #include @@ -38,7 +39,6 @@ #include "autosave.h" #include "core_info.h" #include "configuration.h" -#include "performance.h" #include "movie.h" #include "retroarch.h" #include "runloop.h"