Skip to content

Commit

Permalink
core: format
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Sep 12, 2019
1 parent cdab907 commit 5605dbd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Expand Up @@ -25,7 +25,7 @@ Cpp11BracedListStyle: 'false'
DerivePointerAlignment: 'false'
IncludeBlocks: Regroup
IndentCaseLabels: 'true'
IndentPPDirectives: AfterHash
IndentPPDirectives: None
IndentWidth: '4'
IndentWrappedFunctionNames: 'false'
KeepEmptyLinesAtTheStartOfBlocks: 'false'
Expand Down
2 changes: 1 addition & 1 deletion src/curl-utils.h
Expand Up @@ -28,7 +28,7 @@

#ifdef QUV_HAVE_CURL

# include <curl/curl.h>
#include <curl/curl.h>

void quv_curl_init(void);
CURLcode quv_curl_load_http(DynBuf *dbuf, const char *url);
Expand Down
8 changes: 4 additions & 4 deletions src/misc.c
Expand Up @@ -29,7 +29,7 @@
#include <unistd.h>

#ifdef QUV_HAVE_CURL
# include <curl/curl.h>
#include <curl/curl.h>
#endif


Expand Down Expand Up @@ -322,11 +322,11 @@ void quv_mod_misc_init(JSContext *ctx, JSModuleDef *m) {
JS_DefinePropertyValueStr(ctx, versions, "quv", JS_NewString(ctx, quv_version()), JS_PROP_C_W_E);
JS_DefinePropertyValueStr(ctx, versions, "uv", JS_NewString(ctx, uv_version_string()), JS_PROP_C_W_E);
#ifdef QUV_HAVE_CURL
# ifdef QUV_HAVE_SYSTEM_CURL
#ifdef QUV_HAVE_SYSTEM_CURL
JS_DefinePropertyValueStr(ctx, versions, "curl", JS_NewString(ctx, "system"), JS_PROP_C_W_E);
# else
#else
JS_DefinePropertyValueStr(ctx, versions, "curl", JS_NewString(ctx, curl_version()), JS_PROP_C_W_E);
# endif
#endif
#else
JS_DefinePropertyValueStr(ctx, versions, "curl", JS_UNDEFINED, JS_PROP_C_W_E);
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/qjsc.c
Expand Up @@ -21,6 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "../deps/quickjs/src/cutils.h"
#include "quickjs.h"

#include <assert.h>
#include <errno.h>
#include <inttypes.h>
Expand All @@ -30,9 +33,6 @@
#include <string.h>
#include <unistd.h>

#include "../deps/quickjs/src/cutils.h"
#include "quickjs.h"


/* BEGIN: copied over from quickjs-libc to avoid dependency. */

Expand Down
14 changes: 7 additions & 7 deletions src/utils.h
Expand Up @@ -32,7 +32,7 @@


#ifndef countof
# define countof(x) (sizeof(x) / sizeof((x)[0]))
#define countof(x) (sizeof(x) / sizeof((x)[0]))
#endif

struct AssertionInfo {
Expand All @@ -48,13 +48,13 @@ struct AssertionInfo {
} while (0)

#ifdef __GNUC__
# define LIKELY(expr) __builtin_expect(!!(expr), 1)
# define UNLIKELY(expr) __builtin_expect(!!(expr), 0)
# define PRETTY_FUNCTION_NAME __PRETTY_FUNCTION__
#define LIKELY(expr) __builtin_expect(!!(expr), 1)
#define UNLIKELY(expr) __builtin_expect(!!(expr), 0)
#define PRETTY_FUNCTION_NAME __PRETTY_FUNCTION__
#else
# define LIKELY(expr) expr
# define UNLIKELY(expr) expr
# define PRETTY_FUNCTION_NAME ""
#define LIKELY(expr) expr
#define UNLIKELY(expr) expr
#define PRETTY_FUNCTION_NAME ""
#endif

#define STRINGIFY_(x) #x
Expand Down

0 comments on commit 5605dbd

Please sign in to comment.