summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2012-03-26 13:53:25 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2012-03-26 13:53:25 +0000
commit34af05ec304a9d7f2f67ca7d049cb340b5074abe (patch)
tree4e8c0dd18dd5e9fc45fe6a344aa806c6bebf7038
parent6bd41e47accb059e9dc853d44400e14f63e25f63 (diff)
[trunk] continue work on getting API to use off_t instead of long toward LFS support in JPIP (metadata_manager)
-rw-r--r--applications/jpip/libopenjpip/metadata_manager.c12
-rw-r--r--applications/jpip/libopenjpip/metadata_manager.h6
2 files changed, 10 insertions, 8 deletions
diff --git a/applications/jpip/libopenjpip/metadata_manager.c b/applications/jpip/libopenjpip/metadata_manager.c
index 90af1edc..046f86cb 100644
--- a/applications/jpip/libopenjpip/metadata_manager.c
+++ b/applications/jpip/libopenjpip/metadata_manager.c
@@ -67,7 +67,7 @@ metadatalist_param_t * const_metadatalist( int fd)
int idx;
Byte8_t filesize;
- if(!(filesize = get_filesize( fd)))
+ if(!(filesize = (Byte8_t)get_filesize( fd)))
return NULL;
if( !(toplev_boxlist = get_boxstructure( fd, 0, filesize))){
@@ -182,7 +182,7 @@ void print_allmetadata( metadatalist_param_t *list)
}
}
-boxcontents_param_t * gene_boxcontents( Byte8_t offset, Byte8_t length)
+boxcontents_param_t * gene_boxcontents( OPJ_OFF_T offset, OPJ_SIZE_T length)
{
boxcontents_param_t *contents;
@@ -210,8 +210,10 @@ metadata_param_t * search_metadata( int idx, metadatalist_param_t *list)
return NULL;
}
-int search_metadataidx( char boxtype[4], metadatalist_param_t *list)
+Byte8_t search_metadataidx( char boxtype[4], metadatalist_param_t *list)
{
+ /* MM FIXME: what is the return type of this function ?
+ Byte8_t or int ? */
metadata_param_t *ptr;
int i;
@@ -225,7 +227,7 @@ int search_metadataidx( char boxtype[4], metadatalist_param_t *list)
box_param_t *box = ptr->boxlist->first;
while( box){
if( strncmp ( boxtype, box->type, 4) == 0)
- return ptr->idx;
+ return (Byte8_t)ptr->idx;
box = box->next;
}
}
@@ -245,5 +247,5 @@ int search_metadataidx( char boxtype[4], metadatalist_param_t *list)
}
ptr = ptr->next;
}
- return -1;
+ return (Byte8_t)-1;
}
diff --git a/applications/jpip/libopenjpip/metadata_manager.h b/applications/jpip/libopenjpip/metadata_manager.h
index 5bd0e506..a2e39621 100644
--- a/applications/jpip/libopenjpip/metadata_manager.h
+++ b/applications/jpip/libopenjpip/metadata_manager.h
@@ -35,7 +35,7 @@
#include "placeholder_manager.h"
typedef struct boxcontents_param{
- Byte8_t offset; /**< byte position of the box contents in the file*/
+ OPJ_OFF_T offset; /**< byte position of the box contents in the file*/
Byte8_t length; /**< length of the box contents*/
} boxcontents_param_t;
@@ -103,7 +103,7 @@ void delete_metadata( metadata_param_t **metadata);
*
* @return pointer to the box contents
*/
-boxcontents_param_t * gene_boxcontents( Byte8_t offset, Byte8_t length);
+boxcontents_param_t * gene_boxcontents( OPJ_OFF_T offset, OPJ_SIZE_T length);
/**
* print metadata-bin parameters
@@ -137,7 +137,7 @@ metadata_param_t * search_metadata( int idx, metadatalist_param_t *list);
* @param[in] list metadata-bin list pointer
* @return found metadata-bin index, if not found, -1
*/
-int search_metadataidx( char boxtype[4], metadatalist_param_t *list);
+Byte8_t search_metadataidx( char boxtype[4], metadatalist_param_t *list);
/**