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
6 changes: 0 additions & 6 deletions src/include/checked_cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@

#include "native_client/src/include/build_config.h"

// Windows defines std::min and std::max in a different header
// than gcc prior to Visual Studio 2013.
#if NACL_WINDOWS
#include <xutility>
#endif

#include <algorithm>
#include <limits>

Expand Down
6 changes: 3 additions & 3 deletions src/include/concurrency_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ static INLINE void NaClFlushCacheForDoublyMappedCode(uint8_t *writable_addr,
* We simply prevent the compiler from moving loads or stores around
* this function.
*/
UNREFERENCED_PARAMETER(writable_addr);
UNREFERENCED_PARAMETER(executable_addr);
UNREFERENCED_PARAMETER(size);
NACL_UNUSED_PARAMETER(writable_addr);
NACL_UNUSED_PARAMETER(executable_addr);
NACL_UNUSED_PARAMETER(size);
#if NACL_WINDOWS
_ReadWriteBarrier();
#else
Expand Down
4 changes: 2 additions & 2 deletions src/include/nacl_compiler_annotations.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
#endif

#if NACL_WINDOWS
# define UNREFERENCED_PARAMETER(P) (P)
# define NACL_UNUSED_PARAMETER(P) (P)
#else
# define UNREFERENCED_PARAMETER(P) do { (void) P; } while (0)
# define NACL_UNUSED_PARAMETER(P) do { (void) P; } while (0)
#endif

#if NACL_WINDOWS
Expand Down
8 changes: 4 additions & 4 deletions src/shared/imc/linux/nacl_imc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ static size_t GetRights(struct msghdr* msg, int* fdv) {
* functions so that sigpipe_test continues to link.
*/
NaClHandle NaClBoundSocket(const NaClSocketAddress* address) {
UNREFERENCED_PARAMETER(address);
NACL_UNUSED_PARAMETER(address);
NaClLog(LOG_FATAL, "BoundSocket(): Not used on Linux\n");
return -1;
}

int NaClSendDatagramTo(const NaClMessageHeader* message, int flags,
const NaClSocketAddress* name) {
UNREFERENCED_PARAMETER(message);
UNREFERENCED_PARAMETER(flags);
UNREFERENCED_PARAMETER(name);
NACL_UNUSED_PARAMETER(message);
NACL_UNUSED_PARAMETER(flags);
NACL_UNUSED_PARAMETER(name);
NaClLog(LOG_FATAL, "SendDatagramTo(): Not used on Linux\n");
return -1;
}
Expand Down
10 changes: 5 additions & 5 deletions src/shared/imc/osx/nacl_imc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,16 @@ static bool IgnoreSIGPIPE() {
* functions so that sigpipe_test continues to link.
*/
NaClHandle NaClBoundSocket(const NaClSocketAddress* address) {
UNREFERENCED_PARAMETER(address);
NACL_UNUSED_PARAMETER(address);
NaClLog(LOG_FATAL, "BoundSocket(): Not used on OSX\n");
return -1;
}

int NaClSendDatagramTo(const NaClMessageHeader* message, int flags,
const NaClSocketAddress* name) {
UNREFERENCED_PARAMETER(message);
UNREFERENCED_PARAMETER(flags);
UNREFERENCED_PARAMETER(name);
NACL_UNUSED_PARAMETER(message);
NACL_UNUSED_PARAMETER(flags);
NACL_UNUSED_PARAMETER(name);
NaClLog(LOG_FATAL, "SendDatagramTo(): Not used on OSX\n");
return -1;
}
Expand Down Expand Up @@ -206,7 +206,7 @@ int NaClSendDatagram(NaClHandle handle, const NaClMessageHeader* message,
Header header = { 0, 0 };
int result;
size_t i;
UNREFERENCED_PARAMETER(flags);
NACL_UNUSED_PARAMETER(flags);

assert(CMSG_SPACE(NACL_HANDLE_COUNT_MAX * sizeof(int))
<= CMSG_SPACE_KHANDLE_COUNT_MAX_INTS);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/imc/posix/nacl_imc_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void* NaClMap(struct NaClDescEffector* effp,
PROT_READ | PROT_WRITE | PROT_EXEC
};
int adjusted = 0;
UNREFERENCED_PARAMETER(effp);
NACL_UNUSED_PARAMETER(effp);

if (flags & NACL_ABI_MAP_SHARED) {
adjusted |= MAP_SHARED;
Expand Down
2 changes: 1 addition & 1 deletion src/shared/imc/win/nacl_imc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ int NaClReceiveDatagram(NaClHandle handle, NaClMessageHeader* message,
* If handle is a bound socket, it is a named pipe in non-blocking mode.
* Set is_bound_socket to true if handle has been created by BoundSocket().
*/
if (!GetNamedPipeHandleState(handle, &state, NULL, NULL, NULL, NULL, NULL)) {
if (!GetNamedPipeHandleState(handle, &state, NULL, NULL, NULL, NULL, 0)) {
return -1;
}

Expand Down
6 changes: 3 additions & 3 deletions src/shared/platform/nacl_host_desc_big_file_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static size_t ReadAndCheckLineRange(struct NaClHostDesc *d,

/* visitor for computing number of bytes needed to hold line |ix| */
static size_t BytesNeededForLineRangeOp(void *params, size_t ix) {
UNREFERENCED_PARAMETER(params);
NACL_UNUSED_PARAMETER(params);
return strlen(quotes[ix]);
}

Expand Down Expand Up @@ -345,7 +345,7 @@ static int CheckedPWriteFn(ssize_t (*fn)(struct NaClHostDesc *d,
static size_t BasicReadWriteTest(struct NaClHostDesc *d, void *test_specifics) {
size_t error_count = 0;

UNREFERENCED_PARAMETER(test_specifics);
NACL_UNUSED_PARAMETER(test_specifics);

CheckedSeek(d, ((nacl_off64_t) 0), 0);
error_count += ReadAndCheckLineRange(d, 0, LINES_AT_ZERO);
Expand Down Expand Up @@ -406,7 +406,7 @@ size_t BasicPReadTest(struct NaClHostDesc *d, void *test_specifics) {
static size_t const kNullBytesInHole = 17;
size_t available_bytes;

UNREFERENCED_PARAMETER(test_specifics);
NACL_UNUSED_PARAMETER(test_specifics);

offset_last_line = BytesNeededForLineRange(0, LINES_AT_ZERO - 1);
memset(buffer, 0, sizeof buffer);
Expand Down
4 changes: 2 additions & 2 deletions src/shared/platform/nacl_host_desc_mmap_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int prot_exec_test(struct NaClHostDesc *d, void *test_specifics) {
int param;
int value;

UNREFERENCED_PARAMETER(test_specifics);
NACL_UNUSED_PARAMETER(test_specifics);

if ((uintptr_t) -4095 <
(addr = NaClHostDescMap(d,
Expand Down Expand Up @@ -87,7 +87,7 @@ int map_shared_test(struct NaClHostDesc *d, void *test_specifics) {
char *v1ptr;
char *v2ptr;

UNREFERENCED_PARAMETER(test_specifics);
NACL_UNUSED_PARAMETER(test_specifics);

if ((uintptr_t) -4095 <
(view1 = NaClHostDescMap(d,
Expand Down
14 changes: 7 additions & 7 deletions src/shared/platform/nacl_host_desc_pread_pwrite_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ int SeekPastEndAndWriteTest(struct NaClHostDesc *test_file,
int err;
nacl_off64_t seek_result;

UNREFERENCED_PARAMETER(test_params);
NACL_UNUSED_PARAMETER(test_params);
err = NaClHostDescFstat(test_file, &stbuf);
if (0 != err) {
fprintf(stderr, "SeekPastEndAndWriteTest: fstat failed\n");
Expand Down Expand Up @@ -398,8 +398,8 @@ int PReadWithNegativeOffset(struct NaClHostDesc *test_file,
char buffer[1<<16];
ssize_t result;

UNREFERENCED_PARAMETER(ro_view);
UNREFERENCED_PARAMETER(test_params);
NACL_UNUSED_PARAMETER(ro_view);
NACL_UNUSED_PARAMETER(test_params);

result = NaClHostDescPRead(test_file, buffer, sizeof buffer, -10);
if (result != -NACL_ABI_EINVAL) {
Expand Down Expand Up @@ -434,8 +434,8 @@ int PWriteUsesOffsetSeekReadVerification(struct NaClHostDesc *test_file,
ssize_t io_rv;
nacl_off64_t seek_err;

UNREFERENCED_PARAMETER(ro_view);
UNREFERENCED_PARAMETER(test_params);
NACL_UNUSED_PARAMETER(ro_view);
NACL_UNUSED_PARAMETER(test_params);

CHECK(len <= sizeof buffer);

Expand Down Expand Up @@ -499,7 +499,7 @@ int PWriteUsesOffsetPReadVerification(struct NaClHostDesc *test_file,
char buffer[4096];
ssize_t io_rv;

UNREFERENCED_PARAMETER(test_params);
NACL_UNUSED_PARAMETER(test_params);

CHECK(len <= sizeof buffer);

Expand Down Expand Up @@ -557,7 +557,7 @@ int PWriteUsesOffsetReadPtrVerification(struct NaClHostDesc *test_file,
ssize_t io_rv;
const size_t pwrite_position = 4096;

UNREFERENCED_PARAMETER(test_params);
NACL_UNUSED_PARAMETER(test_params);

seek_err = NaClHostDescSeek(test_file, 0, 0);
if (seek_err < 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/platform/nacl_interruptible_condvar.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void NaClIntrCondVarIntr(struct NaClIntrCondVar *cp) {
}

void NaClIntrCondVarReset(struct NaClIntrCondVar *cp) {
UNREFERENCED_PARAMETER(cp);
NACL_UNUSED_PARAMETER(cp);
/* nothing to do here - we don't keep status */
return;
}
2 changes: 1 addition & 1 deletion src/shared/platform/osx/nacl_semaphore.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ NaClSyncStatus NaClSemPost(struct NaClSemaphore *sem) {
}

int32_t NaClSemGetValue(struct NaClSemaphore *sem) {
UNREFERENCED_PARAMETER(sem);
NACL_UNUSED_PARAMETER(sem);
return -1;
/*
* TODO(gregoryd) - sem_getvalue is declared but not implemented on OSX
Expand Down
6 changes: 3 additions & 3 deletions src/shared/platform/posix/nacl_host_desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ static INLINE void NaClHostDescInit(void) {
}

static INLINE void NaClHostDescExclusiveLock(int host_desc) {
UNREFERENCED_PARAMETER(host_desc);
NACL_UNUSED_PARAMETER(host_desc);
}

static INLINE void NaClHostDescExclusiveUnlock(int host_desc) {
UNREFERENCED_PARAMETER(host_desc);
NACL_UNUSED_PARAMETER(host_desc);
}

#endif
Expand All @@ -217,7 +217,7 @@ uintptr_t NaClHostDescMap(struct NaClHostDesc *d,
int tmp_prot;
int host_flags;
int need_exec;
UNREFERENCED_PARAMETER(effp);
NACL_UNUSED_PARAMETER(effp);

NaClLog(4,
("NaClHostDescMap(0x%08"NACL_PRIxPTR", "
Expand Down
6 changes: 3 additions & 3 deletions src/shared/platform/posix/nacl_secure_random.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ int NaClSecureRngCtor(struct NaClSecureRng *self) {
int NaClSecureRngTestingCtor(struct NaClSecureRng *self,
uint8_t *seed_material,
size_t seed_bytes) {
UNREFERENCED_PARAMETER(self);
UNREFERENCED_PARAMETER(seed_material);
UNREFERENCED_PARAMETER(seed_bytes);
NACL_UNUSED_PARAMETER(self);
NACL_UNUSED_PARAMETER(seed_material);
NACL_UNUSED_PARAMETER(seed_bytes);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/platform/posix/nacl_threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void NaClThreadDtor(struct NaClThread *ntp) {
* and the underlying thread library are responsible for ensuring
* that resources such as the thread stack are properly released.
*/
UNREFERENCED_PARAMETER(ntp);
NACL_UNUSED_PARAMETER(ntp);
}

void NaClThreadJoin(struct NaClThread *ntp) {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/platform/posix/nacl_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void NaClTimeInternalInit(struct NaClTimeState *ntsp) {
}

void NaClTimeInternalFini(struct NaClTimeState *ntsp) {
UNREFERENCED_PARAMETER(ntsp);
NACL_UNUSED_PARAMETER(ntsp);
}

uint64_t NaClTimerResolutionNsInternal(struct NaClTimeState *ntsp) {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/platform/win/nacl_host_desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ int NaClHostDescStat(char const *path, nacl_host_stat_t *nhsp) {
}

int NaClHostDescMkdir(const char *path, int mode) {
UNREFERENCED_PARAMETER(mode);
NACL_UNUSED_PARAMETER(mode);
if (_mkdir(path) != 0)
return -NaClXlateErrno(errno);
return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/shared/platform/win/nacl_secure_random.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ int NaClSecureRngCtor(struct NaClSecureRng *self) {
int NaClSecureRngTestingCtor(struct NaClSecureRng *self,
uint8_t *seed_material,
size_t seed_bytes) {
UNREFERENCED_PARAMETER(seed_material);
UNREFERENCED_PARAMETER(seed_bytes);
NACL_UNUSED_PARAMETER(seed_material);
NACL_UNUSED_PARAMETER(seed_bytes);
self->base.vtbl = NULL;
self->nvalid = 0;
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/shared/platform/win/nacl_semaphore.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int32_t NaClSemGetValue(struct NaClSemaphore *sem) {
NTSTATUS status;
*/
int32_t count = -1;
UNREFERENCED_PARAMETER(sem);
NACL_UNUSED_PARAMETER(sem);
/* TODO(gregoryd): cannot use NtQuerySemaphore without linking to ntdll.lib
status = NtQuerySemaphore(
sem->sem_handle,
Expand Down
2 changes: 1 addition & 1 deletion src/shared/platform/win/nacl_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ int NaClNanosleep(struct nacl_abi_timespec const *req,
uint64_t resolution;
DWORD resolution_gap = 0;

UNREFERENCED_PARAMETER(rem);
NACL_UNUSED_PARAMETER(rem);

/* round up from ns resolution to ms resolution */
/* TODO(bsy): report an error or loop if req->tv_sec does not fit in DWORD */
Expand Down
2 changes: 1 addition & 1 deletion src/tools/tls_edit/tls_edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static void EditMipsCode(void *code, size_t code_length) {

static Bool ConsiderOneInsn(const uint8_t *insn_begin, const uint8_t *insn_end,
uint32_t validation_info, void *data) {
UNREFERENCED_PARAMETER(data);
NACL_UNUSED_PARAMETER(data);
if (insn_begin[0] == 0x65) { /* GS prefix */
if (insn_end - insn_begin < 6) {
ReportError(insn_begin, "Unexpected GS prefix");
Expand Down
2 changes: 1 addition & 1 deletion src/trusted/debug_stub/nacl_debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void NaClDebugStubSetPipe(NaClHandle handle) {
}

void WINAPI NaClStubThread(void *thread_arg) {
UNREFERENCED_PARAMETER(thread_arg);
NACL_UNUSED_PARAMETER(thread_arg);
while (1) {
// Wait for a connection.
if (!g_transport->AcceptConnection()) continue;
Expand Down
4 changes: 2 additions & 2 deletions src/trusted/debug_stub/session_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class DCSocketTransport : public port::ITransport {

virtual void WaitForDebugStubEvent(struct NaClApp *nap,
bool ignore_gdb) {
UNREFERENCED_PARAMETER(nap);
UNREFERENCED_PARAMETER(ignore_gdb);
NACL_UNUSED_PARAMETER(nap);
NACL_UNUSED_PARAMETER(ignore_gdb);
}

virtual void Disconnect() {}
Expand Down
2 changes: 1 addition & 1 deletion src/trusted/debug_stub/target.cc
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ bool Target::IsOnValidInstBoundary(uint32_t addr) {
NACL_INSTR_BLOCK_SIZE,
nap_->cpu_features) == NaClValidationSucceeded;
#else
UNREFERENCED_PARAMETER(addr);
NACL_UNUSED_PARAMETER(addr);
return true;
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/trusted/debug_stub/thread_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ bool Thread::SetStep(bool on) {
return true;
#else
// TODO(mseaborn): Implement for ARM.
UNREFERENCED_PARAMETER(on);
NACL_UNUSED_PARAMETER(on);
return false;
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/trusted/debug_stub/win/platform_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ bool IPlatform::GetMemory(uint64_t virt, uint32_t len, void *dst) {

bool IPlatform::SetMemory(struct NaClApp *nap, uint64_t virt, uint32_t len,
void *src) {
UNREFERENCED_PARAMETER(nap);
NACL_UNUSED_PARAMETER(nap);
uint32_t oldFlags = Reprotect(reinterpret_cast<void *>(virt),
len, PAGE_READWRITE);

Expand Down
2 changes: 1 addition & 1 deletion src/trusted/desc/metadata_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void WINAPI child_thread_fn(void *child_thread_state) {
* create and send a desc with flags, and then with metadata string,
* and then with both.
*/
UNREFERENCED_PARAMETER(child_thread_state);
NACL_UNUSED_PARAMETER(child_thread_state);
sender_thread();
return;
}
Expand Down
Loading