Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused function #453

Open
wants to merge 4 commits into
base: latest
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions docs/benchmark.md
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes seem to be related to a different change - please take them out of this branch so that they can be merged in separate commits.

Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,12 @@ static void CopyElement(benchmark::State& state){
stumpless_set_realloc( copy_element_memory_counter_realloc );
stumpless_set_free( copy_element_memory_counter_free );

element = stumpless_new_element( "copy-element-perf" );
stumpless_add_new_param( element, "param-1", "value-1" );
stumpless_add_new_param( element, "param-2", "value-2" );
element = create_entry("copy-element-perf");

for(auto _ : state){
result = stumpless_copy_element( element );
if( result <= 0 ) {
state.SkipWithError( "could not send an entry to the target" );
state.SkipWithError("the element copy failed");
} else {
stumpless_destroy_element_and_contents( result );
}
Expand Down
6 changes: 0 additions & 6 deletions include/private/strhelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ copy_cstring( const char *str );
char *
copy_cstring_with_length( const char *str, size_t *length );

char *
copy_cstring_length( const char *str, size_t length );

void
to_upper_case( char *str );

int
strncasecmp_custom( const char *s1, const char *s2, size_t n );

Expand Down
25 changes: 0 additions & 25 deletions src/strhelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* limitations under the License.
*/

#include <ctype.h>
#include <stddef.h>
#include <string.h>
#include "private/memory.h"
Expand Down Expand Up @@ -56,30 +55,6 @@ copy_cstring_with_length( const char *str, size_t *length ) {
return new_string;
}

char *
copy_cstring_length( const char *str, size_t length ) {
char *new_string;

new_string = alloc_mem( length + 1 );
if( !new_string ) {
return NULL;
}

memcpy( new_string, str, length );
new_string[length] = '\0';

return new_string;
}

void
to_upper_case( char *str ) {
size_t i;

for( i = 0; str[i]; i++) {
str[i] = toupper( str[i] );
}
}

int
strncasecmp_custom( const char *s1, const char *s2, size_t n ) {
if (n != 0) {
Expand Down
1 change: 1 addition & 0 deletions tools/check_headers/c_standard_library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- "stdlib.h"
- "string.h"
- "time.h"
"tolower": "ctype.h"
"true": "stdbool.h"
"va_end": "stdarg.h"
"va_list": "stdarg.h"
Expand Down
2 changes: 0 additions & 2 deletions tools/check_headers/stumpless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
"copy_cstring_with_length": "private/strhelper.h"
"copy_wel_data": "private/config/wel_supported.h"
"create_entry": "test/helper/fixture.hpp"
"copy_cstring_length": "private/strhelper.h"
"to_upper_case": "private/strhelper.h"
"destroy_buffer_target": "private/target/buffer.h"
"destroy_file_target": "private/target/file.h"
"destroy_network_target": "private/target/network.h"
Expand Down
Loading