[Forensics-changes] [yara] 334/415: Change sizes in arena.c from int32_t to size_t

Hilko Bengen bengen at moszumanska.debian.org
Thu Apr 3 05:43:21 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch debian
in repository yara.

commit d53a2e1d84b371a5b4261a82ca01f7d98b035647
Author: Victor Manuel Alvarez <vmalvarez at virustotal.com>
Date:   Sun Dec 22 14:03:19 2013 +0100

    Change sizes in arena.c from int32_t to size_t
---
 libyara/arena.c | 22 +++++++++++-----------
 libyara/arena.h |  8 ++++----
 libyara/yara.h  |  4 ++--
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/libyara/arena.c b/libyara/arena.c
index be732b8..c170af1 100644
--- a/libyara/arena.c
+++ b/libyara/arena.c
@@ -59,14 +59,14 @@ typedef struct _ARENA_FILE_HEADER
 // Creates a new arena page of a given size
 //
 // Args:
-//    int size  - Size of the page
+//    size_t size  - Size of the page
 //
 // Returns:
 //    A pointer to the newly created YR_ARENA_PAGE structure
 //
 
 YR_ARENA_PAGE* _yr_arena_new_page(
-    int size)
+    size_t size)
 {
   YR_ARENA_PAGE* new_page;
 
@@ -205,7 +205,7 @@ int _yr_arena_make_relocatable(
 // Creates a new arena.
 //
 // Args:
-//    int initial_size  - Initial size
+//    size_t initial_size  - Initial size
 //    int flags         - Flags
 //    YR_ARENA** arena     - Address where a pointer to the new arena will be
 //                        written to.
@@ -215,7 +215,7 @@ int _yr_arena_make_relocatable(
 //
 
 int yr_arena_create(
-    int initial_size,
+    size_t initial_size,
     int flags,
     YR_ARENA** arena)
 {
@@ -490,7 +490,7 @@ int yr_arena_coalesce(
 //
 // Args:
 //    YR_ARENA* arena - Pointer to the arena.
-//    int32_t size - Size of the region to be allocated.
+//    size_t size - Size of the region to be allocated.
 //    void** allocated_memory - Address of a pointer to newly allocated
 //                              region.
 // Returns:
@@ -499,10 +499,10 @@ int yr_arena_coalesce(
 
 int yr_arena_allocate_memory(
     YR_ARENA* arena,
-    int32_t size,
+    size_t size,
     void** allocated_memory)
 {
-  int32_t new_page_size;
+  size_t new_page_size;
   void* new_page_address;
   YR_ARENA_PAGE* new_page;
 
@@ -578,7 +578,7 @@ int yr_arena_allocate_memory(
 //
 // Args:
 //    YR_ARENA* arena - Pointer to the arena.
-//    int32_t size - Size of the region to be allocated.
+//    size_t size - Size of the region to be allocated.
 //    void** allocated_memory - Address of a pointer to newly allocated
 //                              region.
 //    ...          - Variable number of offsets relative to beginning of
@@ -590,7 +590,7 @@ int yr_arena_allocate_memory(
 
 int yr_arena_allocate_struct(
     YR_ARENA* arena,
-    int32_t size,
+    size_t size,
     void** allocated_memory,
     ...)
 {
@@ -653,7 +653,7 @@ int yr_arena_make_relocatable(
 // Args:
 //    YR_ARENA* arena        - Pointer to the arena.
 //    void* data          - Pointer to data to be written.
-//    int32_t size        - Size of data.
+//    size_t size        - Size of data.
 //    void** written_data - Address where a pointer to the written data will
 //                          be returned.
 //
@@ -664,7 +664,7 @@ int yr_arena_make_relocatable(
 int yr_arena_write_data(
     YR_ARENA* arena,
     void* data,
-    int32_t size,
+    size_t size,
     void** written_data)
 {
   void* output;
diff --git a/libyara/arena.h b/libyara/arena.h
index 8a40ee2..d306926 100644
--- a/libyara/arena.h
+++ b/libyara/arena.h
@@ -27,7 +27,7 @@ limitations under the License.
 
 
 int yr_arena_create(
-    int initial_size,
+    size_t initial_size,
     int flags,
     YR_ARENA** arena);
 
@@ -52,13 +52,13 @@ int yr_arena_coalesce(
 
 int yr_arena_allocate_memory(
     YR_ARENA* arena,
-    int32_t size,
+    size_t size,
     void** allocated_memory);
 
 
 int yr_arena_allocate_struct(
     YR_ARENA* arena,
-    int32_t size,
+    size_t size,
     void** allocated_memory,
     ...);
 
@@ -72,7 +72,7 @@ int yr_arena_make_relocatable(
 int yr_arena_write_data(
     YR_ARENA* arena,
     void* data,
-    int32_t size,
+    size_t size,
     void** written_data);
 
 
diff --git a/libyara/yara.h b/libyara/yara.h
index ae952e4..2f6a6ff 100644
--- a/libyara/yara.h
+++ b/libyara/yara.h
@@ -274,8 +274,8 @@ typedef struct _YR_ARENA_PAGE
   uint8_t* new_address;
   uint8_t* address;
 
-  int32_t size;
-  int32_t used;
+  size_t size;
+  size_t used;
 
   YR_RELOC* reloc_list_head;
   YR_RELOC* reloc_list_tail;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list