Changeset 2206 for trunk/libtransmission/makemeta.c
- Timestamp:
- Jun 27, 2007, 5:14:38 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/makemeta.c
r2184 r2206 64 64 else if( S_ISREG( sb.st_mode ) ) 65 65 { 66 struct FileList * node = tr_ malloc( sizeof( struct FileList ));66 struct FileList * node = tr_new( struct FileList, 1 ); 67 67 node->size = sb.st_size; 68 68 node->filename = tr_strdup( buf ); … … 118 118 struct FileList * files; 119 119 struct FileList * walk; 120 tr_metainfo_builder_t * ret = tr_ calloc( 1, sizeof(tr_metainfo_builder_t));120 tr_metainfo_builder_t * ret = tr_new0( tr_metainfo_builder_t, 1 ); 121 121 ret->top = tr_strdup( topFile ); 122 122 ret->handle = handle; … … 143 143 ++ret->fileCount; 144 144 145 ret->files = tr_ calloc(ret->fileCount, sizeof(tr_metainfo_builder_file_t));145 ret->files = tr_new0( tr_metainfo_builder_file_t, ret->fileCount ); 146 146 147 147 for( i=0, walk=files; walk!=NULL; ++i ) … … 194 194 { 195 195 int fileIndex = 0; 196 uint8_t *ret = (uint8_t*) tr_malloc (SHA_DIGEST_LENGTH * b->pieceCount );196 uint8_t *ret = tr_new( uint8_t, SHA_DIGEST_LENGTH * b->pieceCount ); 197 197 uint8_t *walk = ret; 198 uint8_t *buf = tr_ malloc(b->pieceSize );198 uint8_t *buf = tr_new( uint8_t, b->pieceSize ); 199 199 uint64_t totalRemain; 200 200 uint64_t off = 0; … … 423 423 if( lock == NULL ) 424 424 { 425 lock = tr_ calloc( 1, sizeof( tr_lock_t ));425 lock = tr_new0( tr_lock_t, 1 ); 426 426 tr_lockInit( lock ); 427 427 }
Note: See TracChangeset
for help on using the changeset viewer.