Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Dennis Eichhorn 2022-11-20 14:02:11 +01:00
commit fd97920115
3 changed files with 184 additions and 180 deletions

View File

@ -15,8 +15,10 @@
#include <string.h> #include <string.h>
#include <inttypes.h> #include <inttypes.h>
namespace Stdlib { namespace Stdlib
namespace HashTable { {
namespace HashTable
{
typedef struct { typedef struct {
const char *key; const char *key;
void *value; void *value;
@ -213,7 +215,7 @@ namespace Stdlib {
free(table->entries); free(table->entries);
} }
}; }
} }
#endif #endif

View File

@ -13,8 +13,10 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
namespace Utils { namespace Utils
namespace ArraySort { {
namespace ArraySort
{
inline inline
void reverse_int(int *arr, int size) void reverse_int(int *arr, int size)
{ {

View File

@ -22,7 +22,7 @@ namespace Utils {
inline inline
char *search_replace(const char *haystack, const char *needle, const char *replace) char *search_replace(const char *haystack, const char *needle, const char *replace)
{ {
const char* haystackT = haystack; const char *haystackT = haystack;
size_t i; size_t i;
size_t match = 0; size_t match = 0;
@ -83,7 +83,7 @@ namespace Utils {
int size; int size;
} text_diff; } text_diff;
text_diff computeLCSDiff (char **from, int fromSize, char **to, int toSize) text_diff computeLCSDiff(char **from, int fromSize, char **to, int toSize)
{ {
char **diffValues = (char **) malloc(fromSize * toSize * sizeof(char *)); char **diffValues = (char **) malloc(fromSize * toSize * sizeof(char *));
int *diffMasks = (int *) calloc(fromSize * toSize, sizeof(int)); int *diffMasks = (int *) calloc(fromSize * toSize, sizeof(int));
@ -210,7 +210,7 @@ namespace Utils {
ArraySort::reverse_char(diffValues, diffIndex); ArraySort::reverse_char(diffValues, diffIndex);
ArraySort::reverse_int(diffMasks, diffIndex); ArraySort::reverse_int(diffMasks, diffIndex);
return text_diff { diffValues, diffMasks, diffIndex }; return text_diff{diffValues, diffMasks, diffIndex};
} }
} }
} }