Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(590)

Unified Diff: mojo/public/c/system/data_pipe.h

Issue 469393002: Mojo: clang-format mojo/public/c/... and add a presubmit check. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/c/system/buffer.h ('k') | mojo/public/c/system/macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/system/data_pipe.h
diff --git a/mojo/public/c/system/data_pipe.h b/mojo/public/c/system/data_pipe.h
index 2b30504945e88d7a2712abbcc28c16618a0db3ec..c8087eac623cf4ae5dccd35cc5b50cde2e6c06d0 100644
--- a/mojo/public/c/system/data_pipe.h
+++ b/mojo/public/c/system/data_pipe.h
@@ -35,15 +35,15 @@
typedef uint32_t MojoCreateDataPipeOptionsFlags;
#ifdef __cplusplus
-const MojoCreateDataPipeOptionsFlags
- MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE = 0;
+const MojoCreateDataPipeOptionsFlags MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE =
+ 0;
const MojoCreateDataPipeOptionsFlags
MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_MAY_DISCARD = 1 << 0;
#else
#define MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE \
- ((MojoCreateDataPipeOptionsFlags) 0)
+ ((MojoCreateDataPipeOptionsFlags)0)
#define MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_MAY_DISCARD \
- ((MojoCreateDataPipeOptionsFlags) 1 << 0)
+ ((MojoCreateDataPipeOptionsFlags)1 << 0)
#endif
MOJO_COMPILE_ASSERT(MOJO_ALIGNOF(int64_t) == 8, int64_t_has_weird_alignment);
@@ -68,8 +68,8 @@ typedef uint32_t MojoWriteDataFlags;
const MojoWriteDataFlags MOJO_WRITE_DATA_FLAG_NONE = 0;
const MojoWriteDataFlags MOJO_WRITE_DATA_FLAG_ALL_OR_NONE = 1 << 0;
#else
-#define MOJO_WRITE_DATA_FLAG_NONE ((MojoWriteDataFlags) 0)
-#define MOJO_WRITE_DATA_FLAG_ALL_OR_NONE ((MojoWriteDataFlags) 1 << 0)
+#define MOJO_WRITE_DATA_FLAG_NONE ((MojoWriteDataFlags)0)
+#define MOJO_WRITE_DATA_FLAG_ALL_OR_NONE ((MojoWriteDataFlags)1 << 0)
#endif
// |MojoReadDataFlags|: Used to specify different modes to |MojoReadData()| and
@@ -92,10 +92,10 @@ const MojoReadDataFlags MOJO_READ_DATA_FLAG_ALL_OR_NONE = 1 << 0;
const MojoReadDataFlags MOJO_READ_DATA_FLAG_DISCARD = 1 << 1;
const MojoReadDataFlags MOJO_READ_DATA_FLAG_QUERY = 1 << 2;
#else
-#define MOJO_READ_DATA_FLAG_NONE ((MojoReadDataFlags) 0)
-#define MOJO_READ_DATA_FLAG_ALL_OR_NONE ((MojoReadDataFlags) 1 << 0)
-#define MOJO_READ_DATA_FLAG_DISCARD ((MojoReadDataFlags) 1 << 1)
-#define MOJO_READ_DATA_FLAG_QUERY ((MojoReadDataFlags) 1 << 2)
+#define MOJO_READ_DATA_FLAG_NONE ((MojoReadDataFlags)0)
+#define MOJO_READ_DATA_FLAG_ALL_OR_NONE ((MojoReadDataFlags)1 << 0)
+#define MOJO_READ_DATA_FLAG_DISCARD ((MojoReadDataFlags)1 << 1)
+#define MOJO_READ_DATA_FLAG_QUERY ((MojoReadDataFlags)1 << 2)
#endif
#ifdef __cplusplus
@@ -129,8 +129,8 @@ extern "C" {
// |MOJO_RESULT_UNIMPLEMENTED| if an unsupported flag was set in |*options|.
MOJO_SYSTEM_EXPORT MojoResult MojoCreateDataPipe(
const struct MojoCreateDataPipeOptions* options, // Optional.
- MojoHandle* data_pipe_producer_handle, // Out.
- MojoHandle* data_pipe_consumer_handle); // Out.
+ MojoHandle* data_pipe_producer_handle, // Out.
+ MojoHandle* data_pipe_consumer_handle); // Out.
// Writes the given data to the data pipe producer given by
// |data_pipe_producer_handle|. |elements| points to data of size |*num_bytes|;
@@ -168,11 +168,11 @@ MOJO_SYSTEM_EXPORT MojoResult MojoCreateDataPipe(
// |MOJO_WRITE_DATA_FLAG_ALL_OR_NONE| set.
//
// TODO(vtl): Should there be a way of querying how much data can be written?
-MOJO_SYSTEM_EXPORT MojoResult MojoWriteData(
- MojoHandle data_pipe_producer_handle,
- const void* elements,
- uint32_t* num_bytes, // In/out.
- MojoWriteDataFlags flags);
+MOJO_SYSTEM_EXPORT MojoResult
+ MojoWriteData(MojoHandle data_pipe_producer_handle,
+ const void* elements,
+ uint32_t* num_bytes, // In/out.
+ MojoWriteDataFlags flags);
// Begins a two-phase write to the data pipe producer given by
// |data_pipe_producer_handle|. On success, |*buffer| will be a pointer to which
@@ -213,11 +213,11 @@ MOJO_SYSTEM_EXPORT MojoResult MojoWriteData(
// called, but not yet the matching |MojoEndWriteData()|).
// |MOJO_RESULT_SHOULD_WAIT| if no data can currently be written (and the
// consumer is still open).
-MOJO_SYSTEM_EXPORT MojoResult MojoBeginWriteData(
- MojoHandle data_pipe_producer_handle,
- void** buffer, // Out.
- uint32_t* buffer_num_bytes, // In/out.
- MojoWriteDataFlags flags);
+MOJO_SYSTEM_EXPORT MojoResult
+ MojoBeginWriteData(MojoHandle data_pipe_producer_handle,
+ void** buffer, // Out.
+ uint32_t* buffer_num_bytes, // In/out.
+ MojoWriteDataFlags flags);
// Ends a two-phase write to the data pipe producer given by
// |data_pipe_producer_handle| that was begun by a call to
@@ -241,9 +241,9 @@ MOJO_SYSTEM_EXPORT MojoResult MojoBeginWriteData(
// |MOJO_RESULT_FAILED_PRECONDITION| if the data pipe producer is not in a
// two-phase write (e.g., |MojoBeginWriteData()| was not called or
// |MojoEndWriteData()| has already been called).
-MOJO_SYSTEM_EXPORT MojoResult MojoEndWriteData(
- MojoHandle data_pipe_producer_handle,
- uint32_t num_bytes_written);
+MOJO_SYSTEM_EXPORT MojoResult
+ MojoEndWriteData(MojoHandle data_pipe_producer_handle,
+ uint32_t num_bytes_written);
// Reads data from the data pipe consumer given by |data_pipe_consumer_handle|.
// May also be used to discard data or query the amount of data available.
@@ -287,11 +287,10 @@ MOJO_SYSTEM_EXPORT MojoResult MojoEndWriteData(
// |MOJO_RESULT_SHOULD_WAIT| if there is no data to be read or discarded (and
// the producer is still open) and |flags| does *not* have
// |MOJO_READ_DATA_FLAG_ALL_OR_NONE| set.
-MOJO_SYSTEM_EXPORT MojoResult MojoReadData(
- MojoHandle data_pipe_consumer_handle,
- void* elements, // Out.
- uint32_t* num_bytes, // In/out.
- MojoReadDataFlags flags);
+MOJO_SYSTEM_EXPORT MojoResult MojoReadData(MojoHandle data_pipe_consumer_handle,
+ void* elements, // Out.
+ uint32_t* num_bytes, // In/out.
+ MojoReadDataFlags flags);
// Begins a two-phase read from the data pipe consumer given by
// |data_pipe_consumer_handle|. On success, |*buffer| will be a pointer from
@@ -329,11 +328,11 @@ MOJO_SYSTEM_EXPORT MojoResult MojoReadData(
// called, but not yet the matching |MojoEndReadData()|).
// |MOJO_RESULT_SHOULD_WAIT| if no data can currently be read (and the
// producer is still open).
-MOJO_SYSTEM_EXPORT MojoResult MojoBeginReadData(
- MojoHandle data_pipe_consumer_handle,
- const void** buffer, // Out.
- uint32_t* buffer_num_bytes, // In/out.
- MojoReadDataFlags flags);
+MOJO_SYSTEM_EXPORT MojoResult
+ MojoBeginReadData(MojoHandle data_pipe_consumer_handle,
+ const void** buffer, // Out.
+ uint32_t* buffer_num_bytes, // In/out.
+ MojoReadDataFlags flags);
// Ends a two-phase read from the data pipe consumer given by
// |data_pipe_consumer_handle| that was begun by a call to |MojoBeginReadData()|
@@ -354,9 +353,9 @@ MOJO_SYSTEM_EXPORT MojoResult MojoBeginReadData(
// |MOJO_RESULT_FAILED_PRECONDITION| if the data pipe consumer is not in a
// two-phase read (e.g., |MojoBeginReadData()| was not called or
// |MojoEndReadData()| has already been called).
-MOJO_SYSTEM_EXPORT MojoResult MojoEndReadData(
- MojoHandle data_pipe_consumer_handle,
- uint32_t num_bytes_read);
+MOJO_SYSTEM_EXPORT MojoResult
+ MojoEndReadData(MojoHandle data_pipe_consumer_handle,
+ uint32_t num_bytes_read);
#ifdef __cplusplus
} // extern "C"
« no previous file with comments | « mojo/public/c/system/buffer.h ('k') | mojo/public/c/system/macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698