freemyipod r150 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r149‎ | r150 | r151 >
Date:15:09, 18 August 2010
Author:theseven
Status:new
Tags:
Comment:
Add proper copyright header to apps/uninstaller-nano2g/main.c, remove some unused code, and fix a realloc bug
Modified paths:
  • /apps/uninstaller-nano2g/main.c (modified) (history)

Diff [purge]

Index: apps/uninstaller-nano2g/main.c
@@ -1,3 +1,26 @@
 2+//
 3+//
 4+// Copyright 2010 TheSeven
 5+//
 6+//
 7+// This file is part of emBIOS.
 8+//
 9+// emBIOS is free software: you can redistribute it and/or
 10+// modify it under the terms of the GNU General Public License as
 11+// published by the Free Software Foundation, either version 2 of the
 12+// License, or (at your option) any later version.
 13+//
 14+// emBIOS is distributed in the hope that it will be useful,
 15+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 16+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 17+// See the GNU General Public License for more details.
 18+//
 19+// You should have received a copy of the GNU General Public License along
 20+// with emBIOS. If not, see <http://www.gnu.org/licenses/>.
 21+//
 22+//
 23+
 24+
225 #include "embiosapp.h"
326
427
@@ -71,16 +94,6 @@
7295 return freeret(2, buffer);
7396 }
7497
75 -uint32_t readfwptr(const char* filename, void* address, uint32_t* size)
76 -{
77 - uint32_t sector;
78 - uint32_t rc = getfw(filename, &sector, size);
79 - if (rc) return rc;
80 - if (storage_read_sectors_md(0, sector, ((*size + 0x7FF) >> 11), address) != 0) return 1;
81 - *size = decryptfw(address, 0x800);
82 - return 0;
83 -}
84 -
8598 uint32_t readfw(const char* filename, void** address, uint32_t* size)
8699 {
87100 uint32_t sector;
@@ -90,7 +103,7 @@
91104 if (storage_read_sectors_md(0, sector, ((*size + 0x7FF) >> 11), *address) != 0)
92105 return freeret(1, *address);
93106 *size = decryptfw(*address, 0x800);
94 - tlsf_realloc(mallocpool, *address, *size);
 107+ *address = tlsf_realloc(mallocpool, *address, *size);
95108 return 0;
96109 }
97110