rename memory.c and parser.c to be less generic; eliminate hash.c
This commit is contained in:
parent
8d34d06c76
commit
1f350be1f8
|
@ -1952,9 +1952,8 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||||
|
|
||||||
OBJ += cheevos/cheevos.o \
|
OBJ += cheevos/cheevos.o \
|
||||||
cheevos/badges.o \
|
cheevos/badges.o \
|
||||||
cheevos/memory.o \
|
cheevos/cheevos_memory.o \
|
||||||
cheevos/parser.o \
|
cheevos/cheevos_parser.o \
|
||||||
cheevos/hash.o \
|
|
||||||
$(LIBRETRO_COMM_DIR)/formats/cdfs/cdfs.o \
|
$(LIBRETRO_COMM_DIR)/formats/cdfs/cdfs.o \
|
||||||
deps/rcheevos/src/rcheevos/alloc.o \
|
deps/rcheevos/src/rcheevos/alloc.o \
|
||||||
deps/rcheevos/src/rcheevos/compat.o \
|
deps/rcheevos/src/rcheevos/compat.o \
|
||||||
|
|
|
@ -52,9 +52,8 @@
|
||||||
|
|
||||||
#include "badges.h"
|
#include "badges.h"
|
||||||
#include "cheevos.h"
|
#include "cheevos.h"
|
||||||
#include "memory.h"
|
#include "cheevos_memory.h"
|
||||||
#include "parser.h"
|
#include "cheevos_parser.h"
|
||||||
#include "hash.h"
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#include "../file_path_special.h"
|
#include "../file_path_special.h"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "memory.h"
|
#include "cheevos_memory.h"
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "parser.h"
|
#include "cheevos_parser.h"
|
||||||
|
|
||||||
#include "hash.h"
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#include <encodings/utf.h>
|
#include <encodings/utf.h>
|
||||||
|
@ -34,6 +33,17 @@
|
||||||
Gets a value in a JSON
|
Gets a value in a JSON
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
static uint32_t rcheevos_djb2(const char* str, size_t length)
|
||||||
|
{
|
||||||
|
const unsigned char* aux = (const unsigned char*)str;
|
||||||
|
uint32_t hash = 5381;
|
||||||
|
|
||||||
|
while (length--)
|
||||||
|
hash = (hash << 5) + hash + *aux++;
|
||||||
|
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
unsigned key_hash;
|
unsigned key_hash;
|
|
@ -1,12 +0,0 @@
|
||||||
#include "hash.h"
|
|
||||||
|
|
||||||
uint32_t rcheevos_djb2(const char* str, size_t length)
|
|
||||||
{
|
|
||||||
const unsigned char* aux = (const unsigned char*)str;
|
|
||||||
uint32_t hash = 5381;
|
|
||||||
|
|
||||||
while (length--)
|
|
||||||
hash = ( hash << 5 ) + hash + *aux++;
|
|
||||||
|
|
||||||
return hash;
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
/* RetroArch - A frontend for libretro.
|
|
||||||
* Copyright (C) 2015-2018 - Andre Leiradella
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __RARCH_CHEEVOS_HASH_H
|
|
||||||
#define __RARCH_CHEEVOS_HASH_H
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
#include <retro_common_api.h>
|
|
||||||
|
|
||||||
RETRO_BEGIN_DECLS
|
|
||||||
|
|
||||||
uint32_t rcheevos_djb2(const char* str, size_t length);
|
|
||||||
|
|
||||||
RETRO_END_DECLS
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -195,9 +195,8 @@ ACHIEVEMENTS
|
||||||
|
|
||||||
#include "../cheevos/cheevos.c"
|
#include "../cheevos/cheevos.c"
|
||||||
#include "../cheevos/badges.c"
|
#include "../cheevos/badges.c"
|
||||||
#include "../cheevos/memory.c"
|
#include "../cheevos/cheevos_memory.c"
|
||||||
#include "../cheevos/hash.c"
|
#include "../cheevos/cheevos_parser.c"
|
||||||
#include "../cheevos/parser.c"
|
|
||||||
|
|
||||||
#include "../deps/rcheevos/src/rcheevos/alloc.c"
|
#include "../deps/rcheevos/src/rcheevos/alloc.c"
|
||||||
#include "../deps/rcheevos/src/rcheevos/compat.c"
|
#include "../deps/rcheevos/src/rcheevos/compat.c"
|
||||||
|
|
Loading…
Reference in New Issue