Skip to content
Merged
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
2 changes: 1 addition & 1 deletion include/ts/apidefs.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*/

#include <stdbool.h>
#include <stdint.h>
#include <stdint.h> // NOLINT(modernize-deprecated-headers)
#include <sys/types.h>
#include <sys/socket.h>

Expand Down
10 changes: 5 additions & 5 deletions include/tscore/EventNotify.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ class EventNotify
{
public:
EventNotify();
void signal(void);
int wait(void);
void signal();
int wait();
int timedwait(int timeout); // milliseconds
void lock(void);
bool trylock(void);
void unlock(void);
void lock();
bool trylock();
void unlock();
~EventNotify();

private:
Expand Down
4 changes: 2 additions & 2 deletions include/tscore/Extendible.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/

#pragma once
#include "stdint.h"
#include <cstdint>
#include <typeinfo>
#include <typeindex>
#include <cstddef>
Expand Down Expand Up @@ -60,7 +60,7 @@ enum AccessEnum { ATOMIC, BIT, STATIC, ACIDPTR, DIRECT, C_API, NUM_ACCESS_TYPES
inline bool &
areStaticsFrozen()
{
static bool frozen = 0;
static bool frozen = false;
return frozen;
}

Expand Down
12 changes: 6 additions & 6 deletions include/tscore/Hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

struct ATSHashBase {
virtual void update(const void *, size_t) = 0;
virtual void final(void) = 0;
virtual void clear(void) = 0;
virtual void final() = 0;
virtual void clear() = 0;
virtual ~ATSHashBase();
};

Expand All @@ -49,17 +49,17 @@ struct ATSHash : ATSHashBase {
}
};

virtual const void *get(void) const = 0;
virtual size_t size(void) const = 0;
virtual const void *get() const = 0;
virtual size_t size() const = 0;
virtual bool operator==(const ATSHash &) const;
};

struct ATSHash32 : ATSHashBase {
virtual uint32_t get(void) const = 0;
virtual uint32_t get() const = 0;
virtual bool operator==(const ATSHash32 &) const;
};

struct ATSHash64 : ATSHashBase {
virtual uint64_t get(void) const = 0;
virtual uint64_t get() const = 0;
virtual bool operator==(const ATSHash64 &) const;
};
16 changes: 8 additions & 8 deletions include/tscore/HashFNV.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <cstdint>

struct ATSHash32FNV1a : ATSHash32 {
ATSHash32FNV1a(void);
ATSHash32FNV1a();

template <typename Transform> void update(const void *data, size_t len, Transform xfrm);
void
Expand All @@ -40,9 +40,9 @@ struct ATSHash32FNV1a : ATSHash32 {
update(data, len, ATSHash::nullxfrm());
}

void final(void) override;
uint32_t get(void) const override;
void clear(void) override;
void final() override;
uint32_t get() const override;
void clear() override;

private:
uint32_t hval;
Expand All @@ -62,7 +62,7 @@ ATSHash32FNV1a::update(const void *data, size_t len, Transform xfrm)
}

struct ATSHash64FNV1a : ATSHash64 {
ATSHash64FNV1a(void);
ATSHash64FNV1a();

template <typename Transform> void update(const void *data, size_t len, Transform xfrm);
void
Expand All @@ -71,9 +71,9 @@ struct ATSHash64FNV1a : ATSHash64 {
update(data, len, ATSHash::nullxfrm());
}

void final(void) override;
uint64_t get(void) const override;
void clear(void) override;
void final() override;
uint64_t get() const override;
void clear() override;

private:
uint64_t hval;
Expand Down
10 changes: 5 additions & 5 deletions include/tscore/HashMD5.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
#include <openssl/evp.h>

struct ATSHashMD5 : ATSHash {
ATSHashMD5(void);
ATSHashMD5();
void update(const void *data, size_t len) override;
void final(void) override;
const void *get(void) const override;
size_t size(void) const override;
void clear(void) override;
void final() override;
const void *get() const override;
size_t size() const override;
void clear() override;
~ATSHashMD5() override;

private:
Expand Down
8 changes: 4 additions & 4 deletions include/tscore/HashSip.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
*/

struct ATSHash64Sip24 : ATSHash64 {
ATSHash64Sip24(void);
ATSHash64Sip24();
ATSHash64Sip24(const unsigned char key[16]);
ATSHash64Sip24(std::uint64_t key0, std::uint64_t key1);
void update(const void *data, std::size_t len) override;
void final(void) override;
std::uint64_t get(void) const override;
void clear(void) override;
void final() override;
std::uint64_t get() const override;
void clear() override;

private:
unsigned char block_buffer[8] = {0};
Expand Down
2 changes: 1 addition & 1 deletion include/tscore/List.h
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ template <class C, class L = typename C::Link_link> struct SortableQueue : publi

template <class C, class L = typename C::Link_link> struct CountQueue : public Queue<C, L> {
int size;
inline CountQueue(void) : size(0) {}
inline CountQueue() : size(0) {}
inline void push(C *e);
inline C *pop();
inline void enqueue(C *e);
Expand Down
8 changes: 4 additions & 4 deletions include/tscore/MT_hashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ template <class key_t, class data_t> class HashTableIteratorState
template <class key_t, class data_t> class IMTHashTable
{
public:
IMTHashTable(int size, bool (*gc_func)(data_t) = NULL, void (*pre_gc_func)(void) = nullptr)
IMTHashTable(int size, bool (*gc_func)(data_t) = NULL, void (*pre_gc_func)() = nullptr)
{
m_gc_func = gc_func;
m_pre_gc_func = pre_gc_func;
Expand Down Expand Up @@ -136,7 +136,7 @@ template <class key_t, class data_t> class IMTHashTable
data_t remove_entry(HashTableIteratorState<key_t, data_t> *s);

void
GC(void)
GC()
{
if (m_gc_func == NULL) {
return;
Expand Down Expand Up @@ -195,7 +195,7 @@ template <class key_t, class data_t> class IMTHashTable
int cur_size;
int bucket_num;
bool (*m_gc_func)(data_t);
void (*m_pre_gc_func)(void);
void (*m_pre_gc_func)();

private:
IMTHashTable();
Expand Down Expand Up @@ -336,7 +336,7 @@ IMTHashTable<key_t, data_t>::remove_entry(HashTableIteratorState<key_t, data_t>
template <class key_t, class data_t> class MTHashTable
{
public:
MTHashTable(int size, bool (*gc_func)(data_t) = NULL, void (*pre_gc_func)(void) = nullptr)
MTHashTable(int size, bool (*gc_func)(data_t) = NULL, void (*pre_gc_func)() = nullptr)
{
for (int i = 0; i < MT_HASHTABLE_PARTITIONS; i++) {
locks[i] = new_ProxyMutex();
Expand Down
4 changes: 2 additions & 2 deletions include/tscore/hugepages.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

#include <cstring>

size_t ats_hugepage_size(void);
bool ats_hugepage_enabled(void);
size_t ats_hugepage_size();
bool ats_hugepage_enabled();
void ats_hugepage_init(int);
void *ats_alloc_hugepage(size_t);
bool ats_free_hugepage(void *, size_t);
6 changes: 3 additions & 3 deletions include/tscore/ink_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
#pragma once

#include "tscore/ink_config.h"
#include <stddef.h>
#include <stddef.h> // NOLINT(modernize-deprecated-headers)
#include <sys/mman.h>

#ifdef HAVE_STDINT_H
#include <stdint.h>
#include <stdint.h> // NOLINT(modernize-deprecated-headers)
#else
// TODO: Add "standard" int types?
#endif

#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#include <inttypes.h> // NOLINT(modernize-deprecated-headers)
#else
// TODO: add PRI*64 stuff?
#endif
Expand Down
4 changes: 2 additions & 2 deletions include/tscore/ink_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

#pragma once

#include <stdarg.h>
#include <stdio.h>
#include <cstdarg>
#include <cstdio>
#include "tscore/ink_platform.h"
#include "tscore/ink_apidefs.h"

Expand Down
2 changes: 1 addition & 1 deletion include/tscore/ink_llqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ typedef struct llq_s {
ink_semaphore sema;
} LLQ;

LLQ *create_queue(void);
LLQ *create_queue();
int enqueue(LLQ *q, void *data);
void *dequeue(LLQ *q);
bool queue_is_empty(LLQ *q);
Expand Down
8 changes: 4 additions & 4 deletions include/tscore/ink_lockfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@
class Lockfile
{
public:
Lockfile(void) : fd(0) { fname[0] = '\0'; }
Lockfile() : fd(0) { fname[0] = '\0'; }
// coverity[uninit_member]
Lockfile(const char *filename) : fd(0) { ink_strlcpy(fname, filename, sizeof(fname)); }
~Lockfile(void) {}
~Lockfile() {}
void
SetLockfileName(const char *filename)
{
ink_strlcpy(fname, filename, sizeof(fname));
}

const char *
GetLockfileName(void)
GetLockfileName()
{
return fname;
}
Expand All @@ -69,7 +69,7 @@ class Lockfile
// Close()
//
// Closes the file handle on the opened Lockfile.
void Close(void);
void Close();

// Kill()
// KillGroup()
Expand Down
2 changes: 1 addition & 1 deletion include/tscore/ink_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void *ats_track_malloc(size_t size, uint64_t *stat);
void *ats_track_realloc(void *ptr, size_t size, uint64_t *alloc_stat, uint64_t *free_stat);
void ats_track_free(void *ptr, uint64_t *stat);

static inline size_t __attribute__((const)) ats_pagesize(void)
static inline size_t __attribute__((const)) ats_pagesize()
{
static size_t page_size;

Expand Down
18 changes: 9 additions & 9 deletions include/tscore/ink_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
#endif

#include <fcntl.h>
#include <limits.h>
#include <assert.h>
#include <time.h>
#include <limits.h> // NOLINT(modernize-deprecated-headers)
#include <assert.h> // NOLINT(modernize-deprecated-headers)
#include <time.h> // NOLINT(modernize-deprecated-headers)
#include <sys/time.h>
#include <sys/uio.h>
#include <sys/file.h>
#include <sys/resource.h>
#include <errno.h>
#include <errno.h> // NOLINT(modernize-deprecated-headers)
#include <syslog.h>
#include <pwd.h>
#include <poll.h>
Expand All @@ -61,11 +61,11 @@ struct ifafilt;
#include <net/if.h>

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#include <stdlib.h> // NOLINT(modernize-deprecated-headers)
#endif
#include <ctype.h>
#include <ctype.h> // NOLINT(modernize-deprecated-headers)
#ifdef HAVE_STRING_H
#include <string.h>
#include <string.h> // NOLINT(modernize-deprecated-headers)
#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
Expand Down Expand Up @@ -107,7 +107,7 @@ struct ifafilt;
#include <arpa/nameser_compat.h>
#endif

#include <signal.h>
#include <signal.h> // NOLINT(modernize-deprecated-headers)
#ifdef HAVE_SIGINFO_H
#include <siginfo.h>
#endif
Expand Down Expand Up @@ -170,7 +170,7 @@ typedef unsigned int in_addr_t;
#endif

#ifdef HAVE_FLOAT_H
#include <float.h>
#include <float.h> // NOLINT(modernize-deprecated-headers)
#endif

#ifdef HAVE_SYS_SYSMACROS_H
Expand Down
3 changes: 3 additions & 0 deletions include/tscore/ink_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ ink_thread_self()
static inline ink_thread
ink_thread_null()
{
// The implementation of ink_thread (the alias of pthread_t) is different on platforms
// - e.g. `struct pthread *` on Unix and `unsigned long int` on Linux
// NOLINTNEXTLINE(modernize-use-nullptr)
return (ink_thread)0;
}

Expand Down
5 changes: 3 additions & 2 deletions include/tscpp/api/Async.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <memory>
#include <mutex>
#include <unordered_map>
#include <utility>

#include "tscpp/api/noncopyable.h"

Expand Down Expand Up @@ -105,7 +106,7 @@ class AsyncProvider
void
doRun(std::shared_ptr<AsyncDispatchControllerBase> dispatch_controller)
{
dispatch_controller_ = dispatch_controller;
dispatch_controller_ = std::move(dispatch_controller);
run();
}
friend class Async;
Expand Down Expand Up @@ -157,7 +158,7 @@ class AsyncDispatchController : public AsyncDispatchControllerBase
* @param mutex Mutex of the receiver that is locked during the dispatch
*/
AsyncDispatchController(AsyncEventReceiverType *event_receiver, AsyncProviderType *provider, std::shared_ptr<Mutex> mutex)
: event_receiver_(event_receiver), dispatch_mutex_(mutex), provider_(provider)
: event_receiver_(event_receiver), dispatch_mutex_(std::move(mutex)), provider_(provider)
{
}

Expand Down
2 changes: 1 addition & 1 deletion include/tscpp/api/Headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class HeaderField
{
private:
header_field_iterator iter_;
HeaderField(header_field_iterator iter) : iter_(iter) {}
HeaderField(const header_field_iterator &iter) : iter_(iter) {}

public:
typedef unsigned int size_type;
Expand Down
Loading