Skip to content

Commit

Permalink
formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Aug 1, 2014
1 parent b745f3e commit 4f81ad9
Show file tree
Hide file tree
Showing 21 changed files with 80 additions and 79 deletions.
4 changes: 2 additions & 2 deletions src/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ static jl_sym_t **symtab_lookup(jl_sym_t **ptree, const char *str)
uptrint_t h = hash_symbol(str, strlen(str));

// Tree nodes sorted by major key of (int(hash)) and minor key o (str).
while(*ptree != NULL) {
while (*ptree != NULL) {
x = (int)(h-(*ptree)->hash);
if (x == 0) {
x = strcmp(str, (*ptree)->name);
Expand Down Expand Up @@ -521,7 +521,7 @@ DLLEXPORT jl_sym_t *jl_gensym(void)
return jl_symbol(n);
}

DLLEXPORT jl_sym_t *jl_tagged_gensym(const char* str, int32_t len)
DLLEXPORT jl_sym_t *jl_tagged_gensym(const char *str, int32_t len)
{
static char gs_name[14];
char *name = (char*)alloca(sizeof(gs_name)+len+3);
Expand Down
2 changes: 1 addition & 1 deletion src/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ jl_array_t *jl_pchar_to_array(const char *str, size_t len)
jl_value_t *jl_array_to_string(jl_array_t *a)
{
// TODO: check type of array?
jl_datatype_t* string_type = u8_isvalid((char*)a->data, jl_array_len(a)) == 1 ? // ASCII
jl_datatype_t *string_type = u8_isvalid((char*)a->data, jl_array_len(a)) == 1 ? // ASCII
jl_ascii_string_type : jl_utf8_string_type;
jl_value_t *s = (jl_value_t*)alloc_2w();
s->type = (jl_value_t*)string_type;
Expand Down
2 changes: 1 addition & 1 deletion src/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ DLLEXPORT void jl_(void *jl_value)
in_jl_--;
}

DLLEXPORT void jl_breakpoint(jl_value_t* v)
DLLEXPORT void jl_breakpoint(jl_value_t *v)
{
// put a breakpoint in you debugger here
}
Expand Down
2 changes: 1 addition & 1 deletion src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ static Value *emit_ccall(jl_value_t **args, size_t nargs, jl_codectx_t *ctx)
if (fptr == (void *) &jl_is_leaf_type ||
(f_lib==NULL && f_name && !strcmp(f_name, "jl_is_leaf_type"))) {
jl_value_t *arg = args[4];
jl_value_t* ty = expr_type(arg, ctx);
jl_value_t *ty = expr_type(arg, ctx);
if (jl_is_type_type(ty) && !jl_is_typevar(jl_tparam0(ty))) {
int isleaf = jl_is_leaf_type(jl_tparam0(ty));
JL_GC_POP();
Expand Down
8 changes: 4 additions & 4 deletions src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,25 +340,25 @@ static Value *literal_pointer_val(jl_value_t *p)
if (!imaging_mode)
return literal_static_pointer_val(p, jl_pvalue_llvmt);
if (jl_is_datatype(p)) {
jl_datatype_t* addr = (jl_datatype_t*)p;
jl_datatype_t *addr = (jl_datatype_t*)p;
// DataTypes are prefixed with a +
return julia_gv("+", addr->name->name, addr->name->module, p);
}
if (jl_is_func(p)) {
jl_lambda_info_t* linfo = ((jl_function_t*)p)->linfo;
jl_lambda_info_t *linfo = ((jl_function_t*)p)->linfo;
// Functions are prefixed with a -
if (linfo != NULL)
return julia_gv("-", linfo->name, linfo->module, p);
// Anonymous lambdas are prefixed with jl_method#
return julia_gv("jl_method#", p);
}
if (jl_is_lambda_info(p)) {
jl_lambda_info_t* linfo = (jl_lambda_info_t*)p;
jl_lambda_info_t *linfo = (jl_lambda_info_t*)p;
// Type-inferred functions are prefixed with a -
return julia_gv("-", linfo->name, linfo->module, p);
}
if (jl_is_symbol(p)) {
jl_sym_t* addr = (jl_sym_t*)p;
jl_sym_t *addr = (jl_sym_t*)p;
// Symbols are prefixed with jl_sym#
return julia_gv("jl_sym#", addr, NULL, p);
}
Expand Down
8 changes: 4 additions & 4 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ struct jl_varinfo_t {
static void jl_gen_llvm_gv_array();

extern "C"
void jl_dump_bitcode(char* fname)
void jl_dump_bitcode(char *fname)
{
std::string err;
#ifdef LLVM35
Expand All @@ -383,7 +383,7 @@ void jl_dump_bitcode(char* fname)
}

extern "C"
void jl_dump_objfile(char* fname, int jit_model)
void jl_dump_objfile(char *fname, int jit_model)
{
std::string err;
#ifdef LLVM35
Expand Down Expand Up @@ -3853,9 +3853,9 @@ static Function *emit_function(jl_lambda_info_t *lam, bool cstyle)

// --- initialization ---

static MDNode* tbaa_make_child( const char* name, MDNode* parent, bool isConstant=false )
static MDNode *tbaa_make_child( const char *name, MDNode *parent, bool isConstant=false )
{
MDNode* n = mbuilder->createTBAANode(name,parent,isConstant);
MDNode *n = mbuilder->createTBAANode(name,parent,isConstant);
#ifdef LLVM35
n->setValueName( ValueName::Create(name));
#else
Expand Down
14 changes: 7 additions & 7 deletions src/debuginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ void jl_getDylibFunctionInfo(const char **name, int *line, const char **filename
if (fbase != 0) {
#else
Dl_info dlinfo;
const char* fname = 0;
const char *fname = 0;
if ((dladdr((void*)pointer, &dlinfo) != 0) && dlinfo.dli_fname) {
if (skipC && !jl_is_sysimg(dlinfo.dli_fname))
return;
Expand Down Expand Up @@ -465,10 +465,10 @@ void jl_getFunctionInfo(const char **name, int *line, const char **filename, siz


#if defined(_OS_WINDOWS_) && defined(_CPU_X86_64_)
extern "C" void* CALLBACK jl_getUnwindInfo(HANDLE hProcess, ULONG64 AddrBase, ULONG64 UserContext);
extern "C" void *CALLBACK jl_getUnwindInfo(HANDLE hProcess, ULONG64 AddrBase, ULONG64 UserContext);
#ifndef USE_MCJIT

void* CALLBACK jl_getUnwindInfo(HANDLE hProcess, ULONG64 AddrBase, ULONG64 UserContext)
void *CALLBACK jl_getUnwindInfo(HANDLE hProcess, ULONG64 AddrBase, ULONG64 UserContext)
{
std::map<size_t, FuncInfo, revcomp> &info = jl_jit_events->getMap();
std::map<size_t, FuncInfo, revcomp>::iterator it = info.lower_bound(AddrBase);
Expand Down Expand Up @@ -502,10 +502,10 @@ class JITMemoryManagerWin : public JITMemoryManager {
virtual uint8_t *allocateSpace(intptr_t Size, unsigned Alignment) { return JMM->allocateSpace(Size,Alignment); }
virtual uint8_t *allocateGlobal(uintptr_t Size, unsigned Alignment) { return JMM->allocateGlobal(Size,Alignment); }
virtual void deallocateFunctionBody(void *Body) { return JMM->deallocateFunctionBody(Body); }
virtual uint8_t* startExceptionTable(const Function* F,
virtual uint8_t *startExceptionTable(const Function* F,
uintptr_t &ActualSize) { return JMM->startExceptionTable(F,ActualSize); }
virtual void endExceptionTable(const Function *F, uint8_t *TableStart,
uint8_t *TableEnd, uint8_t* FrameRegister) { return JMM->endExceptionTable(F,TableStart,TableEnd,FrameRegister); }
uint8_t *TableEnd, uint8_t *FrameRegister) { return JMM->endExceptionTable(F,TableStart,TableEnd,FrameRegister); }
virtual void deallocateExceptionTable(void *ET) { return JMM->deallocateExceptionTable(ET); }
virtual bool CheckInvariants(std::string &str) { return JMM->CheckInvariants(str); }
virtual size_t GetDefaultCodeSlabSize() { return JMM->GetDefaultCodeSlabSize(); }
Expand Down Expand Up @@ -533,7 +533,7 @@ class JITMemoryManagerWin : public JITMemoryManager {
};

#else
void* CALLBACK jl_getUnwindInfo(HANDLE hProcess, ULONG64 AddrBase, ULONG64 UserContext)
void *CALLBACK jl_getUnwindInfo(HANDLE hProcess, ULONG64 AddrBase, ULONG64 UserContext)
{
return NULL;
}
Expand Down Expand Up @@ -565,7 +565,7 @@ static void coverageVisitLine(std::string filename, int line)
v);
}

void write_log_data(logdata_t logData, const char* extension)
void write_log_data(logdata_t logData, const char *extension)
{
std::string base = std::string(julia_home);
base = base + "/../share/julia/base/";
Expand Down
6 changes: 3 additions & 3 deletions src/disasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ using namespace llvm;
namespace {
class FuncMCView : public MemoryObject {
private:
const char* Fptr;
const char *Fptr;
size_t Fsize;
public:
FuncMCView(const void* fptr, size_t size) : Fptr((const char*)fptr), Fsize(size) {}
FuncMCView(const void *fptr, size_t size) : Fptr((const char*)fptr), Fsize(size) {}

const char* operator[] (const size_t idx) { return (Fptr+idx); }
const char *operator[] (const size_t idx) { return (Fptr+idx); }

uint64_t getBase() const { return 0; }
uint64_t getExtent() const { return Fsize; }
Expand Down
4 changes: 2 additions & 2 deletions src/dlload.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ char *jl_lookup_soname(char *pfx, size_t n);

#define JL_RTLD(flags, FLAG) (flags & JL_RTLD_ ## FLAG ? RTLD_ ## FLAG : 0)

static int jl_uv_dlopen(const char* filename, uv_lib_t* lib, unsigned flags)
static int jl_uv_dlopen(const char *filename, uv_lib_t *lib, unsigned flags)
{
#if defined(_OS_WINDOWS_)
needsSymRefreshModuleList = 1;
Expand Down Expand Up @@ -107,7 +107,7 @@ static uv_lib_t *jl_load_dynamic_library_(char *modname, unsigned flags, int thr
if (!error) goto done;
}
else if (jl_base_module != NULL) {
jl_array_t* DL_LOAD_PATH = (jl_array_t*)jl_get_global(jl_base_module, jl_symbol("DL_LOAD_PATH"));
jl_array_t *DL_LOAD_PATH = (jl_array_t*)jl_get_global(jl_base_module, jl_symbol("DL_LOAD_PATH"));
if (DL_LOAD_PATH != NULL) {
size_t j;
for (j = 0; j < jl_array_len(DL_LOAD_PATH); j++) {
Expand Down
2 changes: 1 addition & 1 deletion src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ static jl_value_t *jl_deserialize_value_internal(ios_t *s)
return NULL;
}

static jl_value_t* jl_deserialize_value(ios_t *s)
static jl_value_t *jl_deserialize_value(ios_t *s)
{
jl_value_t *v = jl_deserialize_value_internal(s);
assert(v != DTINSTANCE_PLACEHOLDER);
Expand Down
2 changes: 1 addition & 1 deletion src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ JL_CALLABLE(jl_apply_generic)
return jl_no_method_error((jl_function_t*)F, args, nargs);
}
assert(!mfunc->linfo || !mfunc->linfo->inInference);
jl_value_t* res = jl_apply(mfunc, args, nargs);
jl_value_t *res = jl_apply(mfunc, args, nargs);
JL_GC_POP();
return res;
}
Expand Down
10 changes: 5 additions & 5 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ void sigint_handler(int sig, siginfo_t *info, void *context)
struct uv_shutdown_queue_item { uv_handle_t *h; struct uv_shutdown_queue_item *next; };
struct uv_shutdown_queue { struct uv_shutdown_queue_item *first; struct uv_shutdown_queue_item *last; };

static void jl_uv_exitcleanup_add(uv_handle_t* handle, struct uv_shutdown_queue *queue)
static void jl_uv_exitcleanup_add(uv_handle_t *handle, struct uv_shutdown_queue *queue)
{
struct uv_shutdown_queue_item *item = (struct uv_shutdown_queue_item*)malloc(sizeof(struct uv_shutdown_queue_item));
item->h = handle;
Expand All @@ -401,7 +401,7 @@ static void jl_uv_exitcleanup_add(uv_handle_t* handle, struct uv_shutdown_queue
queue->last = item;
}

static void jl_uv_exitcleanup_walk(uv_handle_t* handle, void *arg)
static void jl_uv_exitcleanup_walk(uv_handle_t *handle, void *arg)
{
if (handle != (uv_handle_t*)jl_uv_stdout && handle != (uv_handle_t*)jl_uv_stderr)
jl_uv_exitcleanup_add(handle, (struct uv_shutdown_queue*)arg);
Expand Down Expand Up @@ -434,7 +434,7 @@ DLLEXPORT void uv_atexit_hook()

jl_gc_run_all_finalizers();

uv_loop_t* loop = jl_global_event_loop();
uv_loop_t *loop = jl_global_event_loop();
struct uv_shutdown_queue queue = {NULL, NULL};
uv_walk(loop, jl_uv_exitcleanup_walk, &queue);
// close stdout and stderr last, since we like being
Expand Down Expand Up @@ -736,7 +736,7 @@ void julia_init(char *imageFile)
init_stdio();

#if defined(JL_USE_INTEL_JITEVENTS)
const char* jit_profiling = getenv("ENABLE_JITPROFILING");
const char *jit_profiling = getenv("ENABLE_JITPROFILING");
if (jit_profiling && atoi(jit_profiling)) {
jl_using_intel_jitevents = 1;
#if defined(__linux__)
Expand Down Expand Up @@ -961,7 +961,7 @@ DLLEXPORT void jl_install_sigint_handler()
}

extern int asprintf(char **str, const char *fmt, ...);
extern void * __stack_chk_guard;
extern void *__stack_chk_guard;

DLLEXPORT int julia_trampoline(int argc, char **argv, int (*pmain)(int ac,char *av[]))
{
Expand Down
Loading

0 comments on commit 4f81ad9

Please sign in to comment.