diff options
author | neb@chromium.org <neb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-28 22:15:13 +0000 |
---|---|---|
committer | neb@chromium.org <neb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-28 22:15:13 +0000 |
commit | 748ce719f7594754695dfbd17b35618a58a5ffd1 (patch) | |
tree | cb8c9a30d8d8d64c4cfcbd3429535c3e6ec116c1 /ppapi/c | |
parent | afbdbf11a0beb96ac10459e5748db0f5abc41ef5 (diff) | |
download | chromium_src-748ce719f7594754695dfbd17b35618a58a5ffd1.zip chromium_src-748ce719f7594754695dfbd17b35618a58a5ffd1.tar.gz chromium_src-748ce719f7594754695dfbd17b35618a58a5ffd1.tar.bz2 |
Fix up some types in the API.
size_t -> int32_t, char* -> void* for buffers, void* -> const void* where needed.
We already use int32_t when we serialize size_t (and unlike pointers, size_ts do get serialized a lot).
char* for representing unstructured blocks of memory is weird, see "man 2 read" and friends. I'm removing it because it complicates our type system in IDL for no reason.
const void* should be obvious.
BUG=76271
TEST=none
Review URL: http://codereview.chromium.org/6711047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79623 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c')
-rw-r--r-- | ppapi/c/dev/ppb_context_3d_trusted_dev.h | 4 | ||||
-rw-r--r-- | ppapi/c/pp_stdint.h | 2 | ||||
-rw-r--r-- | ppapi/c/ppb_audio.h | 8 | ||||
-rw-r--r-- | ppapi/c/ppb_core.h | 6 | ||||
-rw-r--r-- | ppapi/c/ppb_url_loader.h | 2 | ||||
-rw-r--r-- | ppapi/c/ppb_url_request_info.h | 2 | ||||
-rw-r--r-- | ppapi/c/private/ppb_flash_net_connector.h | 4 |
7 files changed, 13 insertions, 15 deletions
diff --git a/ppapi/c/dev/ppb_context_3d_trusted_dev.h b/ppapi/c/dev/ppb_context_3d_trusted_dev.h index 944b041..f8a0d9c 100644 --- a/ppapi/c/dev/ppb_context_3d_trusted_dev.h +++ b/ppapi/c/dev/ppb_context_3d_trusted_dev.h @@ -11,7 +11,7 @@ #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_stdint.h" -#define PPB_CONTEXT_3D_TRUSTED_DEV_INTERFACE "PPB_Context3DTrusted(Dev);0.2" +#define PPB_CONTEXT_3D_TRUSTED_DEV_INTERFACE "PPB_Context3DTrusted(Dev);0.3" typedef enum { kNoError, @@ -77,7 +77,7 @@ struct PPB_Context3DTrusted_Dev { // Create a transfer buffer and return a handle that uniquely // identifies it or -1 on error. - int32_t (*CreateTransferBuffer)(PP_Resource context, size_t size); + int32_t (*CreateTransferBuffer)(PP_Resource context, uint32_t size); // Destroy a transfer buffer and recycle the handle. PP_Bool (*DestroyTransferBuffer)(PP_Resource context, int32_t id); diff --git a/ppapi/c/pp_stdint.h b/ppapi/c/pp_stdint.h index ed397f5..6117af6 100644 --- a/ppapi/c/pp_stdint.h +++ b/ppapi/c/pp_stdint.h @@ -49,7 +49,5 @@ typedef unsigned __int64 uint64_t; #include <stdint.h> #endif -#include <stddef.h> /* Needed for size_t. */ - #endif /* PPAPI_C_PP_STDINT_H_ */ diff --git a/ppapi/c/ppb_audio.h b/ppapi/c/ppb_audio.h index 53f58ea..5abb8ec 100644 --- a/ppapi/c/ppb_audio.h +++ b/ppapi/c/ppb_audio.h @@ -11,7 +11,7 @@ #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_stdint.h" -#define PPB_AUDIO_INTERFACE "PPB_Audio;0.5" +#define PPB_AUDIO_INTERFACE "PPB_Audio;0.6" /** * @file @@ -31,7 +31,7 @@ * fill the audio buffer with data. */ typedef void (*PPB_Audio_Callback)(void* sample_buffer, - size_t buffer_size_in_bytes, + uint32_t buffer_size_in_bytes, void* user_data); /** * @} @@ -50,8 +50,8 @@ typedef void (*PPB_Audio_Callback)(void* sample_buffer, * A C++ example: * * void audio_callback(void* sample_buffer, - * size_t buffer_size_in_bytes, - * void* user_data) { + * uint32_t buffer_size_in_bytes, + * void* user_data) { * ... fill in the buffer with samples ... * } * diff --git a/ppapi/c/ppb_core.h b/ppapi/c/ppb_core.h index 6571db0..59efc24 100644 --- a/ppapi/c/ppb_core.h +++ b/ppapi/c/ppb_core.h @@ -13,7 +13,7 @@ struct PP_CompletionCallback; -#define PPB_CORE_INTERFACE "PPB_Core;0.3" +#define PPB_CORE_INTERFACE "PPB_Core;0.4" /** * @file @@ -54,11 +54,11 @@ struct PPB_Core { /** * MemAlloc is a pointer to a function that allocate memory. * - * @param[in] num_bytes A size_t number of bytes to allocate. + * @param[in] num_bytes A number of bytes to allocate. * @return A pointer to the memory if successful, NULL If the * allocation fails. */ - void* (*MemAlloc)(size_t num_bytes); + void* (*MemAlloc)(uint32_t num_bytes); /** * MemFree is a pointer to a function that deallocates memory. diff --git a/ppapi/c/ppb_url_loader.h b/ppapi/c/ppb_url_loader.h index 8dfc409..34a16da 100644 --- a/ppapi/c/ppb_url_loader.h +++ b/ppapi/c/ppb_url_loader.h @@ -96,7 +96,7 @@ struct PPB_URLLoader { // perform a partial read. Returns the number of bytes read or an error // code. int32_t (*ReadResponseBody)(PP_Resource loader, - char* buffer, + void* buffer, int32_t bytes_to_read, struct PP_CompletionCallback callback); diff --git a/ppapi/c/ppb_url_request_info.h b/ppapi/c/ppb_url_request_info.h index 441a02c..aad1c9e 100644 --- a/ppapi/c/ppb_url_request_info.h +++ b/ppapi/c/ppb_url_request_info.h @@ -87,7 +87,7 @@ struct PPB_URLRequestInfo { // // Returns PP_FALSE if any of the parameters are invalid, PP_TRUE on success. PP_Bool (*AppendDataToBody)(PP_Resource request, - const char* data, + const void* data, uint32_t len); // Append a file reference to be uploaded. diff --git a/ppapi/c/private/ppb_flash_net_connector.h b/ppapi/c/private/ppb_flash_net_connector.h index 555e9df..2cc25bb 100644 --- a/ppapi/c/private/ppb_flash_net_connector.h +++ b/ppapi/c/private/ppb_flash_net_connector.h @@ -10,11 +10,11 @@ #include "ppapi/c/pp_resource.h" #include "ppapi/c/private/ppb_flash_file.h" // For |PP_FileHandle|. -#define PPB_FLASH_NETCONNECTOR_INTERFACE "PPB_Flash_NetConnector;1" +#define PPB_FLASH_NETCONNECTOR_INTERFACE "PPB_Flash_NetConnector;0.1" // This is an opaque type holding a network address. struct PP_Flash_NetAddress { - size_t size; + uint32_t size; char data[128]; }; |