aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/support
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-03-26 13:19:07 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-03-26 13:19:07 -0700
commit92b3f568dbd1bf15c85cddac8d8f57a5a58201ef (patch)
tree57cbb547c3e2feee2737df86382b422d37ebb3c0 /src/core/support
parentc63a09eb6ceb547c73b674f48a5833412cd5f08f (diff)
parent94f908ae84ab6d280a41e09245925ecfa612dce8 (diff)
Merge github.com:grpc/grpc into fuzzy-bits
Diffstat (limited to 'src/core/support')
-rw-r--r--src/core/support/alloc.c2
-rw-r--r--src/core/support/cmdline.c4
-rw-r--r--src/core/support/cpu_linux.c6
-rw-r--r--src/core/support/cpu_posix.c2
-rw-r--r--src/core/support/env_posix.c4
-rw-r--r--src/core/support/histogram.c4
-rw-r--r--src/core/support/host_port.c4
-rw-r--r--src/core/support/log_android.c6
-rw-r--r--src/core/support/log_linux.c8
-rw-r--r--src/core/support/log_posix.c8
-rw-r--r--src/core/support/log_win32.c6
-rw-r--r--src/core/support/stack_lockfree.c10
-rw-r--r--src/core/support/string.h2
-rw-r--r--src/core/support/string_posix.c4
-rw-r--r--src/core/support/string_win32.c2
-rw-r--r--src/core/support/subprocess_posix.c8
-rw-r--r--src/core/support/subprocess_windows.c2
-rw-r--r--src/core/support/sync.c2
-rw-r--r--src/core/support/sync_posix.c2
-rw-r--r--src/core/support/thd_posix.c8
-rw-r--r--src/core/support/thd_win32.c4
-rw-r--r--src/core/support/time.c2
-rw-r--r--src/core/support/time_posix.c2
-rw-r--r--src/core/support/time_win32.c4
24 files changed, 53 insertions, 53 deletions
diff --git a/src/core/support/alloc.c b/src/core/support/alloc.c
index b99584bd20..fd9fb8f5e7 100644
--- a/src/core/support/alloc.c
+++ b/src/core/support/alloc.c
@@ -33,9 +33,9 @@
#include <grpc/support/alloc.h>
-#include <stdlib.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
+#include <stdlib.h>
#include "src/core/profiling/timers.h"
static gpr_allocation_functions g_alloc_functions = {malloc, realloc, free};
diff --git a/src/core/support/cmdline.c b/src/core/support/cmdline.c
index b517f30b2d..eff46a1655 100644
--- a/src/core/support/cmdline.c
+++ b/src/core/support/cmdline.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,10 +37,10 @@
#include <stdio.h>
#include <string.h>
-#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
+#include "src/core/support/string.h"
typedef enum { ARGTYPE_INT, ARGTYPE_BOOL, ARGTYPE_STRING } argtype;
diff --git a/src/core/support/cpu_linux.c b/src/core/support/cpu_linux.c
index 7af6a8f009..5597df2d03 100644
--- a/src/core/support/cpu_linux.c
+++ b/src/core/support/cpu_linux.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -39,10 +39,10 @@
#ifdef GPR_CPU_LINUX
-#include <sched.h>
#include <errno.h>
-#include <unistd.h>
+#include <sched.h>
#include <string.h>
+#include <unistd.h>
#include <grpc/support/cpu.h>
#include <grpc/support/log.h>
diff --git a/src/core/support/cpu_posix.c b/src/core/support/cpu_posix.c
index 8f01c284ca..e508ddd8ca 100644
--- a/src/core/support/cpu_posix.c
+++ b/src/core/support/cpu_posix.c
@@ -36,8 +36,8 @@
#ifdef GPR_CPU_POSIX
#include <errno.h>
-#include <unistd.h>
#include <string.h>
+#include <unistd.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
diff --git a/src/core/support/env_posix.c b/src/core/support/env_posix.c
index 1dd2af56bc..256212be76 100644
--- a/src/core/support/env_posix.c
+++ b/src/core/support/env_posix.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,8 @@
#include <grpc/support/log.h>
-#include "src/core/support/string.h"
#include <grpc/support/string_util.h>
+#include "src/core/support/string.h"
char *gpr_getenv(const char *name) {
char *result = getenv(name);
diff --git a/src/core/support/histogram.c b/src/core/support/histogram.c
index 20ed2b14b1..62227be1a6 100644
--- a/src/core/support/histogram.c
+++ b/src/core/support/histogram.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,8 +38,8 @@
#include <string.h>
#include <grpc/support/alloc.h>
-#include <grpc/support/port_platform.h>
#include <grpc/support/log.h>
+#include <grpc/support/port_platform.h>
#include <grpc/support/useful.h>
/* Histograms are stored with exponentially increasing bucket sizes.
diff --git a/src/core/support/host_port.c b/src/core/support/host_port.c
index 23f65b1581..31243a7221 100644
--- a/src/core/support/host_port.c
+++ b/src/core/support/host_port.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -35,10 +35,10 @@
#include <string.h>
-#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
+#include "src/core/support/string.h"
int gpr_join_host_port(char **out, const char *host, int port) {
if (host[0] != '[' && strchr(host, ':') != NULL) {
diff --git a/src/core/support/log_android.c b/src/core/support/log_android.c
index 5d0c7d820d..640c9d7099 100644
--- a/src/core/support/log_android.c
+++ b/src/core/support/log_android.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -35,12 +35,12 @@
#ifdef GPR_ANDROID
+#include <android/log.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
-#include <stdio.h>
#include <stdarg.h>
+#include <stdio.h>
#include <string.h>
-#include <android/log.h>
static android_LogPriority severity_to_log_priority(gpr_log_severity severity) {
switch (severity) {
diff --git a/src/core/support/log_linux.c b/src/core/support/log_linux.c
index d66b7a3cc0..e60512c526 100644
--- a/src/core/support/log_linux.c
+++ b/src/core/support/log_linux.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -47,12 +47,12 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
-#include <stdio.h>
+#include <linux/unistd.h>
#include <stdarg.h>
+#include <stdio.h>
#include <string.h>
-#include <time.h>
-#include <linux/unistd.h>
#include <sys/syscall.h>
+#include <time.h>
#include <unistd.h>
static long gettid(void) { return syscall(__NR_gettid); }
diff --git a/src/core/support/log_posix.c b/src/core/support/log_posix.c
index 3ff171f99c..7429dd0a2c 100644
--- a/src/core/support/log_posix.c
+++ b/src/core/support/log_posix.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,12 +38,12 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
-#include <stdio.h>
+#include <pthread.h>
#include <stdarg.h>
-#include <string.h>
#include <stdio.h>
+#include <stdio.h>
+#include <string.h>
#include <time.h>
-#include <pthread.h>
static intptr_t gettid(void) { return (intptr_t)pthread_self(); }
diff --git a/src/core/support/log_win32.c b/src/core/support/log_win32.c
index e18e667fe5..89ec0917d5 100644
--- a/src/core/support/log_win32.c
+++ b/src/core/support/log_win32.c
@@ -35,14 +35,14 @@
#ifdef GPR_WIN32
-#include <stdio.h>
#include <stdarg.h>
+#include <stdio.h>
#include <grpc/support/alloc.h>
-#include <grpc/support/log_win32.h>
#include <grpc/support/log.h>
-#include <grpc/support/time.h>
+#include <grpc/support/log_win32.h>
#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
#include "src/core/support/string.h"
#include "src/core/support/string_win32.h"
diff --git a/src/core/support/stack_lockfree.c b/src/core/support/stack_lockfree.c
index 9daecd2e18..8e0bbfaee8 100644
--- a/src/core/support/stack_lockfree.c
+++ b/src/core/support/stack_lockfree.c
@@ -36,10 +36,10 @@
#include <stdlib.h>
#include <string.h>
-#include <grpc/support/port_platform.h>
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
+#include <grpc/support/port_platform.h>
/* The lockfree node structure is a single architecture-level
word that allows for an atomic CAS to set it up. */
@@ -64,10 +64,10 @@ typedef union lockfree_node {
struct lockfree_node_contents contents;
} lockfree_node;
-#define ENTRY_ALIGNMENT_BITS 3 /* make sure that entries aligned to 8-bytes */
-#define INVALID_ENTRY_INDEX \
- ((1 << 16) - 1) /* reserve this entry as invalid \
- */
+/* make sure that entries aligned to 8-bytes */
+#define ENTRY_ALIGNMENT_BITS 3
+/* reserve this entry as invalid */
+#define INVALID_ENTRY_INDEX ((1 << 16) - 1)
struct gpr_stack_lockfree {
lockfree_node *entries;
diff --git a/src/core/support/string.h b/src/core/support/string.h
index a367ed7cd8..8ff16882ab 100644
--- a/src/core/support/string.h
+++ b/src/core/support/string.h
@@ -37,8 +37,8 @@
#include <stddef.h>
#include <grpc/support/port_platform.h>
-#include <grpc/support/slice_buffer.h>
#include <grpc/support/slice.h>
+#include <grpc/support/slice_buffer.h>
#ifdef __cplusplus
extern "C" {
diff --git a/src/core/support/string_posix.c b/src/core/support/string_posix.c
index 25c333db4e..a73b3106a5 100644
--- a/src/core/support/string_posix.c
+++ b/src/core/support/string_posix.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -35,8 +35,8 @@
#ifdef GPR_POSIX_STRING
-#include <stdio.h>
#include <stdarg.h>
+#include <stdio.h>
#include <string.h>
#include <grpc/support/alloc.h>
diff --git a/src/core/support/string_win32.c b/src/core/support/string_win32.c
index 3b1f702cf1..0780907994 100644
--- a/src/core/support/string_win32.c
+++ b/src/core/support/string_win32.c
@@ -37,8 +37,8 @@
#ifdef GPR_WIN32
-#include <stdio.h>
#include <stdarg.h>
+#include <stdio.h>
#include <string.h>
#include <grpc/support/alloc.h>
diff --git a/src/core/support/subprocess_posix.c b/src/core/support/subprocess_posix.c
index 171054e4da..662e7dd999 100644
--- a/src/core/support/subprocess_posix.c
+++ b/src/core/support/subprocess_posix.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,15 +37,15 @@
#include <grpc/support/subprocess.h>
-#include <unistd.h>
#include <assert.h>
#include <errno.h>
-#include <stdio.h>
-#include <string.h>
#include <signal.h>
+#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <unistd.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
diff --git a/src/core/support/subprocess_windows.c b/src/core/support/subprocess_windows.c
index 2b25ef063a..6afbefeb2b 100644
--- a/src/core/support/subprocess_windows.c
+++ b/src/core/support/subprocess_windows.c
@@ -35,9 +35,9 @@
#ifdef GPR_WINDOWS_SUBPROCESS
-#include <windows.h>
#include <string.h>
#include <tchar.h>
+#include <windows.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
diff --git a/src/core/support/sync.c b/src/core/support/sync.c
index 69e3e39c5c..800cf20287 100644
--- a/src/core/support/sync.c
+++ b/src/core/support/sync.c
@@ -33,9 +33,9 @@
/* Generic implementation of synchronization primitives. */
+#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
-#include <grpc/support/atm.h>
/* Number of mutexes to allocate for events, to avoid lock contention.
Should be a prime. */
diff --git a/src/core/support/sync_posix.c b/src/core/support/sync_posix.c
index d3c483f1b5..be4d0ac1c9 100644
--- a/src/core/support/sync_posix.c
+++ b/src/core/support/sync_posix.c
@@ -36,10 +36,10 @@
#ifdef GPR_POSIX_SYNC
#include <errno.h>
-#include <time.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
+#include <time.h>
#include "src/core/profiling/timers.h"
void gpr_mu_init(gpr_mu* mu) { GPR_ASSERT(pthread_mutex_init(mu, NULL) == 0); }
diff --git a/src/core/support/thd_posix.c b/src/core/support/thd_posix.c
index 653a1c88c1..4d874d3656 100644
--- a/src/core/support/thd_posix.c
+++ b/src/core/support/thd_posix.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,13 +37,13 @@
#ifdef GPR_POSIX_SYNC
-#include <pthread.h>
-#include <stdlib.h>
-#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/thd.h>
#include <grpc/support/useful.h>
+#include <pthread.h>
+#include <stdlib.h>
+#include <string.h>
struct thd_arg {
void (*body)(void *arg); /* body of a thread */
diff --git a/src/core/support/thd_win32.c b/src/core/support/thd_win32.c
index a9db180c1b..630eb7f625 100644
--- a/src/core/support/thd_win32.c
+++ b/src/core/support/thd_win32.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,10 +37,10 @@
#ifdef GPR_WIN32
-#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/thd.h>
+#include <string.h>
#if defined(_MSC_VER)
#define thread_local __declspec(thread)
diff --git a/src/core/support/time.c b/src/core/support/time.c
index 423d12ffc0..0e2c8fcf1a 100644
--- a/src/core/support/time.c
+++ b/src/core/support/time.c
@@ -33,11 +33,11 @@
/* Generic implementation of time calls. */
+#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
-#include <grpc/support/log.h>
int gpr_time_cmp(gpr_timespec a, gpr_timespec b) {
int cmp = (a.tv_sec > b.tv_sec) - (a.tv_sec < b.tv_sec);
diff --git a/src/core/support/time_posix.c b/src/core/support/time_posix.c
index 36d75e7da2..f999e08cb0 100644
--- a/src/core/support/time_posix.c
+++ b/src/core/support/time_posix.c
@@ -98,9 +98,9 @@ gpr_timespec gpr_now(gpr_clock_type clock_type) {
#else
/* For some reason Apple's OSes haven't implemented clock_gettime. */
-#include <sys/time.h>
#include <mach/mach.h>
#include <mach/mach_time.h>
+#include <sys/time.h>
static double g_time_scale;
static uint64_t g_time_start;
diff --git a/src/core/support/time_win32.c b/src/core/support/time_win32.c
index 8af957e6f4..2c344d3f3b 100644
--- a/src/core/support/time_win32.c
+++ b/src/core/support/time_win32.c
@@ -39,10 +39,10 @@
#include <grpc/support/log.h>
#include <grpc/support/time.h>
+#include <limits.h>
+#include <process.h>
#include <src/core/support/time_precise.h>
#include <sys/timeb.h>
-#include <process.h>
-#include <limits.h>
#include "src/core/support/block_annotate.h"