From 7ac9bfdb44b36898599b5ba74d6bc376b9326b88 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 20 Oct 2020 19:21:40 +0200 Subject: [PATCH] memcached_set_encoding_key: header mixup --- src/libmemcached/common.h | 3 +- src/libmemcached/encoding_key.cc | 19 ++++--------- src/libmemcached/encoding_key.h | 48 -------------------------------- 3 files changed, 6 insertions(+), 64 deletions(-) delete mode 100644 src/libmemcached/encoding_key.h diff --git a/src/libmemcached/common.h b/src/libmemcached/common.h index e62709b2..df3fd180 100644 --- a/src/libmemcached/common.h +++ b/src/libmemcached/common.h @@ -1,5 +1,5 @@ /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * + * * LibMemcached * * Copyright (C) 2011 Data Differential, http://datadifferential.com/ @@ -168,7 +168,6 @@ memcached_instance_st* memcached_instance_fetch(memcached_st *ptr, uint32_t serv # include "libmemcached/assert.hpp" # include "libmemcached/server.hpp" # include "libmemcached/key.hpp" -# include "libmemcached/encoding_key.h" # include "libmemcached/result.h" # include "libmemcached/version.hpp" #endif diff --git a/src/libmemcached/encoding_key.cc b/src/libmemcached/encoding_key.cc index c0b99ab9..714dd1cc 100644 --- a/src/libmemcached/encoding_key.cc +++ b/src/libmemcached/encoding_key.cc @@ -1,5 +1,5 @@ /* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * + * * Libmemcached library * * Copyright (C) 2011-2013 Data Differential, http://datadifferential.com/ @@ -36,21 +36,12 @@ */ #include "libmemcached/common.h" -#include "libmemcached/assert.hpp" - -static void _set_encoding_key(Memcached& memc, const char *key, size_t key_length) -{ - hashkit_key(&memc.hashkit, key, key_length); -} memcached_return_t memcached_set_encoding_key(memcached_st* shell, const char *key, size_t key_length) { - Memcached* memc= memcached2Memcached(shell); - if (memc) - { - _set_encoding_key(*memc, key, key_length); - return MEMCACHED_SUCCESS; + if (!shell) { + return MEMCACHED_INVALID_ARGUMENTS; } - - return MEMCACHED_INVALID_ARGUMENTS; + hashkit_key(&shell->hashkit, key, key_length); + return MEMCACHED_SUCCESS; } diff --git a/src/libmemcached/encoding_key.h b/src/libmemcached/encoding_key.h deleted file mode 100644 index a2c47b08..00000000 --- a/src/libmemcached/encoding_key.h +++ /dev/null @@ -1,48 +0,0 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2012 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - - memcached_string_t memcached_encoding_key(Memcached&); - -#ifdef __cplusplus -} -#endif -- 2.30.2