Skip to content

Commit

Permalink
Remove trailing whitespace (#46)
Browse files Browse the repository at this point in the history
Not purely cosmetic because it breaks navigation with { and } in the
One True Editor.
  • Loading branch information
bnoordhuis authored Nov 12, 2023
1 parent 15f798d commit 162a8b7
Show file tree
Hide file tree
Showing 33 changed files with 967 additions and 967 deletions.
4 changes: 2 additions & 2 deletions cutils.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* C utilities
*
*
* Copyright (c) 2017 Fabrice Bellard
* Copyright (c) 2018 Charlie Gordon
*
Expand Down Expand Up @@ -174,7 +174,7 @@ int __attribute__((format(printf, 2, 3))) dbuf_printf(DynBuf *s,
va_list ap;
char buf[128];
int len;

va_start(ap, fmt);
len = vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
Expand Down
16 changes: 8 additions & 8 deletions cutils.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* C utilities
*
*
* Copyright (c) 2017 Fabrice Bellard
* Copyright (c) 2018 Charlie Gordon
*
Expand Down Expand Up @@ -220,13 +220,13 @@ static inline uint32_t bswap32(uint32_t v)

static inline uint64_t bswap64(uint64_t v)
{
return ((v & ((uint64_t)0xff << (7 * 8))) >> (7 * 8)) |
((v & ((uint64_t)0xff << (6 * 8))) >> (5 * 8)) |
((v & ((uint64_t)0xff << (5 * 8))) >> (3 * 8)) |
((v & ((uint64_t)0xff << (4 * 8))) >> (1 * 8)) |
((v & ((uint64_t)0xff << (3 * 8))) << (1 * 8)) |
((v & ((uint64_t)0xff << (2 * 8))) << (3 * 8)) |
((v & ((uint64_t)0xff << (1 * 8))) << (5 * 8)) |
return ((v & ((uint64_t)0xff << (7 * 8))) >> (7 * 8)) |
((v & ((uint64_t)0xff << (6 * 8))) >> (5 * 8)) |
((v & ((uint64_t)0xff << (5 * 8))) >> (3 * 8)) |
((v & ((uint64_t)0xff << (4 * 8))) >> (1 * 8)) |
((v & ((uint64_t)0xff << (3 * 8))) << (1 * 8)) |
((v & ((uint64_t)0xff << (2 * 8))) << (3 * 8)) |
((v & ((uint64_t)0xff << (1 * 8))) << (5 * 8)) |
((v & ((uint64_t)0xff << (0 * 8))) << (7 * 8));
}

Expand Down
2 changes: 1 addition & 1 deletion examples/fib.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* QuickJS: Example of C module
*
*
* Copyright (c) 2017-2018 Fabrice Bellard
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
2 changes: 1 addition & 1 deletion examples/pi_bigint.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function calc_pi(prec) {
const CHUD_C = 640320n;
const CHUD_C3 = 10939058860032000n; /* C^3/24 */
const CHUD_BITS_PER_TERM = 47.11041313821584202247; /* log2(C/12)*3 */

/* return [P, Q, G] */
function chud_bs(a, b, need_G) {
var c, P, Q, G, P1, Q1, G1, P2, Q2, G2;
Expand Down
12 changes: 6 additions & 6 deletions examples/point.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* QuickJS: Example of C module with a class
*
*
* Copyright (c) 2019 Fabrice Bellard
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -49,7 +49,7 @@ static JSValue js_point_ctor(JSContext *ctx,
JSPointData *s;
JSValue obj = JS_UNDEFINED;
JSValue proto;

s = js_mallocz(ctx, sizeof(*s));
if (!s)
return JS_EXCEPTION;
Expand Down Expand Up @@ -112,7 +112,7 @@ static JSValue js_point_norm(JSContext *ctx, JSValueConst this_val,
static JSClassDef js_point_class = {
"Point",
.finalizer = js_point_finalizer,
};
};

static const JSCFunctionListEntry js_point_proto_funcs[] = {
JS_CGETSET_MAGIC_DEF("x", js_point_get_xy, js_point_set_xy, 0),
Expand All @@ -123,19 +123,19 @@ static const JSCFunctionListEntry js_point_proto_funcs[] = {
static int js_point_init(JSContext *ctx, JSModuleDef *m)
{
JSValue point_proto, point_class;

/* create the Point class */
JS_NewClassID(&js_point_class_id);
JS_NewClass(JS_GetRuntime(ctx), js_point_class_id, &js_point_class);

point_proto = JS_NewObject(ctx);
JS_SetPropertyFunctionList(ctx, point_proto, js_point_proto_funcs, countof(js_point_proto_funcs));

point_class = JS_NewCFunction2(ctx, js_point_ctor, "Point", 2, JS_CFUNC_constructor, 0);
/* set proto.constructor and ctor.prototype */
JS_SetConstructor(ctx, point_class, point_proto);
JS_SetClassProto(ctx, js_point_class_id, point_proto);

JS_SetModuleExport(ctx, m, "Point", point_class);
return 0;
}
Expand Down
Loading

0 comments on commit 162a8b7

Please sign in to comment.