Bug 798564 - remove prtypes.h #includes in modules/libmar/; r=ehsan

This commit is contained in:
Nathan Froyd 2013-01-23 16:36:59 -05:00
parent d1d2c01489
commit 76f0dcebc0
4 changed files with 10 additions and 15 deletions

View File

@ -7,8 +7,7 @@
#ifndef MAR_H__
#define MAR_H__
/* We use NSPR here just to import the definition of uint32_t */
#include "prtypes.h"
#include "mozilla/Assertions.h"
#include "mozilla/StandardInteger.h"
#ifdef __cplusplus
@ -22,7 +21,7 @@ extern "C" {
* code in tool/mar.c.
*/
#define MAX_SIGNATURES 8
PR_STATIC_ASSERT(MAX_SIGNATURES <= 9);
MOZ_STATIC_ASSERT(MAX_SIGNATURES <= 9, "too many signatures");
struct ProductInformationBlock {
const char *MARChannelID;
@ -67,7 +66,7 @@ typedef int (* MarItemCallback)(MarFile *mar, const MarItem *item, void *data);
MarFile *mar_open(const char *path);
#ifdef XP_WIN
MarFile *mar_wopen(const PRUnichar *path);
MarFile *mar_wopen(const wchar_t *path);
#endif
/**

View File

@ -6,7 +6,6 @@
#define MAR_CMDLINE_H__
/* We use NSPR here just to import the definition of uint32_t */
#include "prtypes.h"
#ifdef __cplusplus
extern "C" {

View File

@ -7,15 +7,10 @@
#ifndef MAR_PRIVATE_H__
#define MAR_PRIVATE_H__
#include "prtypes.h"
#include "limits.h"
#include "mozilla/Assertions.h"
#include "mozilla/StandardInteger.h"
/* Code in this module requires a guarantee that the size
of uint32_t and uint64_t are 4 and 8 bytes respectively. */
PR_STATIC_ASSERT(sizeof(uint32_t) == 4);
PR_STATIC_ASSERT(sizeof(uint64_t) == 8);
#define BLOCKSIZE 4096
#define ROUND_UP(n, incr) (((n) / (incr) + 1) * (incr))
@ -32,12 +27,14 @@ PR_STATIC_ASSERT(sizeof(uint64_t) == 8);
/* Existing code makes assumptions that the file size is
smaller than LONG_MAX. */
PR_STATIC_ASSERT(MAX_SIZE_OF_MAR_FILE < ((int64_t)LONG_MAX));
MOZ_STATIC_ASSERT(MAX_SIZE_OF_MAR_FILE < ((int64_t)LONG_MAX),
"max mar file size is too big");
/* We store at most the size up to the signature block + 4
bytes per BLOCKSIZE bytes */
PR_STATIC_ASSERT(sizeof(BLOCKSIZE) < \
(SIGNATURE_BLOCK_OFFSET + sizeof(uint32_t)));
MOZ_STATIC_ASSERT(sizeof(BLOCKSIZE) < \
(SIGNATURE_BLOCK_OFFSET + sizeof(uint32_t)),
"BLOCKSIZE is too big");
/* The maximum size of any signature supported by current and future
implementations of the signmar program. */

View File

@ -175,7 +175,7 @@ MarFile *mar_open(const char *path) {
}
#ifdef XP_WIN
MarFile *mar_wopen(const PRUnichar *path) {
MarFile *mar_wopen(const wchar_t *path) {
FILE *fp;
fp = _wfopen(path, L"rb");