Skip to content

Commit

Permalink
Tidy up some C style
Browse files Browse the repository at this point in the history
- SymbolValue / SetSymbolValue should take lispobj, not u64.

- pseudo-atomic must explicitly depend on the header that declares "lose()"
  otherwise the C compiler could warn "did you mean close?" differing
  based on whether some other header included "interr.h"
  (And "interr" depends on the header that defines the preprocessor macro
  'never_returns'. It's non-self-containedness all the way down)
  • Loading branch information
snuglas committed May 9, 2018
1 parent bfc02d7 commit d9c5c02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/runtime/pseudo-atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#ifndef PSEUDO_ATOMIC_H
#define PSEUDO_ATOMIC_H

#include "interr.h"

#if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)

#define set_alloc_pointer(value) dynamic_space_free_pointer = (lispobj*)(value)
Expand Down
8 changes: 4 additions & 4 deletions src/runtime/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ tls_index_of(struct symbol *symbol) // untagged pointer
#endif

static inline lispobj
SymbolValue(u64 tagged_symbol_pointer, void *thread)
SymbolValue(lispobj tagged_symbol_pointer, void *thread)
{
struct symbol *sym= SYMBOL(tagged_symbol_pointer);
struct symbol *sym = SYMBOL(tagged_symbol_pointer);
if(thread && tls_index_of(sym)) {
lispobj r = per_thread_value(sym, thread);
if(r!=NO_TLS_VALUE_MARKER_WIDETAG) return r;
Expand All @@ -121,9 +121,9 @@ SymbolValue(u64 tagged_symbol_pointer, void *thread)
}

static inline void
SetSymbolValue(u64 tagged_symbol_pointer,lispobj val, void *thread)
SetSymbolValue(lispobj tagged_symbol_pointer,lispobj val, void *thread)
{
struct symbol *sym= SYMBOL(tagged_symbol_pointer);
struct symbol *sym = SYMBOL(tagged_symbol_pointer);
if(thread && tls_index_of(sym)) {
if (per_thread_value(sym, thread) != NO_TLS_VALUE_MARKER_WIDETAG) {
per_thread_value(sym, thread) = val;
Expand Down

0 comments on commit d9c5c02

Please sign in to comment.