Bug 579517 follow-up: Remove NSPR types that crept in

This commit is contained in:
Ehsan Akhgari 2013-06-12 21:26:59 -04:00
Родитель ca49dd2fe8
Коммит f6ad445a82
9 изменённых файлов: 45 добавлений и 45 удалений

Просмотреть файл

@ -86,7 +86,7 @@ nsNodeInfoManager::NodeInfoInnerKeyCompare(const void *key1, const void *key2)
static void* PR_CALLBACK
AllocTable(void* pool, PRSize size)
AllocTable(void* pool, size_t size)
{
return malloc(size);
}
@ -104,7 +104,7 @@ AllocEntry(void* pool, const void* key)
}
static void PR_CALLBACK
FreeEntry(void* pool, PLHashEntry* he, PRUintn flag)
FreeEntry(void* pool, PLHashEntry* he, unsigned flag)
{
if (flag == HT_FREE_ENTRY) {
free(he);

Просмотреть файл

@ -41,7 +41,7 @@ NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
/* attribute unsigned long allowedDirections; */
NS_IMETHODIMP
nsDOMSimpleGestureEvent::GetAllowedDirections(PRUint32 *aAllowedDirections)
nsDOMSimpleGestureEvent::GetAllowedDirections(uint32_t *aAllowedDirections)
{
NS_ENSURE_ARG_POINTER(aAllowedDirections);
*aAllowedDirections =
@ -50,7 +50,7 @@ nsDOMSimpleGestureEvent::GetAllowedDirections(PRUint32 *aAllowedDirections)
}
NS_IMETHODIMP
nsDOMSimpleGestureEvent::SetAllowedDirections(PRUint32 aAllowedDirections)
nsDOMSimpleGestureEvent::SetAllowedDirections(uint32_t aAllowedDirections)
{
static_cast<nsSimpleGestureEvent*>(mEvent)->allowedDirections =
aAllowedDirections;

Просмотреть файл

@ -429,13 +429,13 @@ int AudioStream::MaxNumberOfChannels()
return static_cast<int>(maxNumberOfChannels);
}
static void SetUint16LE(PRUint8* aDest, PRUint16 aValue)
static void SetUint16LE(uint8_t* aDest, uint16_t aValue)
{
aDest[0] = aValue & 0xFF;
aDest[1] = aValue >> 8;
}
static void SetUint32LE(PRUint8* aDest, PRUint32 aValue)
static void SetUint32LE(uint8_t* aDest, uint32_t aValue)
{
SetUint16LE(aDest, aValue & 0xFFFF);
SetUint16LE(aDest + 2, aValue >> 16);
@ -453,7 +453,7 @@ OpenDumpFile(AudioStream* aStream)
return nullptr;
++gDumpedAudioCount;
PRUint8 header[] = {
uint8_t header[] = {
// RIFF header
0x52, 0x49, 0x46, 0x46, 0x00, 0x00, 0x00, 0x00, 0x57, 0x41, 0x56, 0x45,
// fmt chunk. We always write 16-bit samples.
@ -474,25 +474,25 @@ OpenDumpFile(AudioStream* aStream)
}
static void
WriteDumpFile(FILE* aDumpFile, AudioStream* aStream, PRUint32 aFrames,
WriteDumpFile(FILE* aDumpFile, AudioStream* aStream, uint32_t aFrames,
void* aBuffer)
{
if (!aDumpFile)
return;
PRUint32 samples = aStream->GetChannels()*aFrames;
uint32_t samples = aStream->GetChannels()*aFrames;
if (AUDIO_OUTPUT_FORMAT == AUDIO_FORMAT_S16) {
fwrite(aBuffer, 2, samples, aDumpFile);
return;
}
NS_ASSERTION(AUDIO_OUTPUT_FORMAT == AUDIO_FORMAT_FLOAT32, "bad format");
nsAutoTArray<PRUint8, 1024*2> buf;
nsAutoTArray<uint8_t, 1024*2> buf;
buf.SetLength(samples*2);
float* input = static_cast<float*>(aBuffer);
PRUint8* output = buf.Elements();
for (PRUint32 i = 0; i < samples; ++i) {
SetUint16LE(output + i*2, PRInt16(input[i]*32767.0f));
uint8_t* output = buf.Elements();
for (uint32_t i = 0; i < samples; ++i) {
SetUint16LE(output + i*2, int16_t(input[i]*32767.0f));
}
fwrite(output, 2, samples, aDumpFile);
fflush(aDumpFile);

Просмотреть файл

@ -269,7 +269,7 @@ CompositorOGL::CreateContext()
void
CompositorOGL::AddPrograms(ShaderProgramType aType)
{
for (PRUint32 maskType = MaskNone; maskType < NumMaskTypes; ++maskType) {
for (uint32_t maskType = MaskNone; maskType < NumMaskTypes; ++maskType) {
if (ProgramProfileOGL::ProgramExists(aType, static_cast<MaskType>(maskType))) {
mPrograms[aType].mVariations[maskType] = new ShaderProgramOGL(this->gl(),
ProgramProfileOGL::GetProfileFor(aType, static_cast<MaskType>(maskType)));
@ -409,7 +409,7 @@ CompositorOGL::Initialize()
mGLContext->fGenFramebuffers(1, &testFBO);
GLuint testTexture = 0;
for (PRUint32 i = 0; i < ArrayLength(textureTargets); i++) {
for (uint32_t i = 0; i < ArrayLength(textureTargets); i++) {
GLenum target = textureTargets[i];
if (!target)
continue;
@ -664,7 +664,7 @@ void
CompositorOGL::SetLayerProgramProjectionMatrix(const gfx3DMatrix& aMatrix)
{
for (unsigned int i = 0; i < mPrograms.Length(); ++i) {
for (PRUint32 mask = MaskNone; mask < NumMaskTypes; ++mask) {
for (uint32_t mask = MaskNone; mask < NumMaskTypes; ++mask) {
if (mPrograms[i].mVariations[mask]) {
mPrograms[i].mVariations[mask]->CheckAndSetProjectionMatrix(aMatrix);
}
@ -1183,7 +1183,7 @@ CompositorOGL::DrawQuad(const Rect& aRect, const Rect& aClipRect,
return;
}
for (PRInt32 pass = 1; pass <=2; ++pass) {
for (int32_t pass = 1; pass <=2; ++pass) {
ShaderProgramOGL* program;
if (pass == 1) {
program = GetProgram(gl::ComponentAlphaPass1ProgramType, maskType);
@ -1323,7 +1323,7 @@ CompositorOGL::CopyToTarget(gfxContext *aTarget, const gfxMatrix& aTransform)
GLint width = rect.width;
GLint height = rect.height;
if ((PRInt64(width) * PRInt64(height) * PRInt64(4)) > PR_INT32_MAX) {
if ((int64_t(width) * int64_t(height) * int64_t(4)) > PR_INT32_MAX) {
NS_ERROR("Widget size too big - integer overflow!");
return;
}

Просмотреть файл

@ -86,7 +86,7 @@ MessageLoop* MessageLoop::current() {
return lazy_tls_ptr.Pointer()->Get();
}
PRInt32 message_loop_id_seq = 0;
int32_t message_loop_id_seq = 0;
MessageLoop::MessageLoop(Type type)
: type_(type),

Просмотреть файл

@ -220,7 +220,7 @@ public:
Type type() const { return type_; }
// Unique, non-repeating ID for this message loop.
PRInt32 id() const { return id_; }
int32_t id() const { return id_; }
// Optional call to connect the thread name with this loop.
void set_thread_name(const std::string& thread_name) {
@ -377,7 +377,7 @@ public:
virtual bool DoIdleWork();
Type type_;
PRInt32 id_;
int32_t id_;
// A list of tasks that need to be processed by this instance. Note that
// this queue is only accessed (push/pop) by our current thread.

Просмотреть файл

@ -1132,11 +1132,11 @@ nsresult
nsNSSComponent::setEnabledTLSVersions(nsIPrefBranch * prefBranch)
{
// keep these values in sync with security-prefs.js and firefox.js
static const PRInt32 PSM_DEFAULT_MIN_TLS_VERSION = 0;
static const PRInt32 PSM_DEFAULT_MAX_TLS_VERSION = 1;
static const int32_t PSM_DEFAULT_MIN_TLS_VERSION = 0;
static const int32_t PSM_DEFAULT_MAX_TLS_VERSION = 1;
PRInt32 minVersion = PSM_DEFAULT_MIN_TLS_VERSION;
PRInt32 maxVersion = PSM_DEFAULT_MAX_TLS_VERSION;
int32_t minVersion = PSM_DEFAULT_MIN_TLS_VERSION;
int32_t maxVersion = PSM_DEFAULT_MAX_TLS_VERSION;
mPrefBranch->GetIntPref("security.tls.version.min", &minVersion);
mPrefBranch->GetIntPref("security.tls.version.max", &maxVersion);
@ -1144,10 +1144,10 @@ nsNSSComponent::setEnabledTLSVersions(nsIPrefBranch * prefBranch)
minVersion += SSL_LIBRARY_VERSION_3_0;
maxVersion += SSL_LIBRARY_VERSION_3_0;
SSLVersionRange range = { (PRUint16) minVersion, (PRUint16) maxVersion };
SSLVersionRange range = { (uint16_t) minVersion, (uint16_t) maxVersion };
if (minVersion != (PRInt32) range.min || // prevent truncation
maxVersion != (PRInt32) range.max || // prevent truncation
if (minVersion != (int32_t) range.min || // prevent truncation
maxVersion != (int32_t) range.max || // prevent truncation
SSL_VersionRangeSetDefault(ssl_variant_stream, &range) != SECSuccess) {
range.min = SSL_LIBRARY_VERSION_3_0 + PSM_DEFAULT_MIN_TLS_VERSION;
range.max = SSL_LIBRARY_VERSION_3_0 + PSM_DEFAULT_MAX_TLS_VERSION;

Просмотреть файл

@ -274,7 +274,7 @@ typedef NSInteger NSEventGestureAxis;
#ifdef __LP64__
// Support for fluid swipe tracking.
BOOL* mCancelSwipeAnimation;
PRUint32 mCurrentSwipeDir;
uint32_t mCurrentSwipeDir;
#endif
// Whether this uses off-main-thread compositing.

Просмотреть файл

@ -3695,10 +3695,10 @@ NSEvent* gLastDragMouseDownEvent = nil;
#ifdef __LP64__
- (bool)sendSwipeEvent:(NSEvent*)aEvent
withKind:(PRUint32)aMsg
allowedDirections:(PRUint32*)aAllowedDirections
direction:(PRUint32)aDirection
delta:(PRFloat64)aDelta
withKind:(uint32_t)aMsg
allowedDirections:(uint32_t*)aAllowedDirections
direction:(uint32_t)aDirection
delta:(double)aDelta
{
if (!mGeckoChild)
return false;
@ -3712,10 +3712,10 @@ NSEvent* gLastDragMouseDownEvent = nil;
}
- (void)sendSwipeEndEvent:(NSEvent *)anEvent
allowedDirections:(PRUint32)aAllowedDirections
allowedDirections:(uint32_t)aAllowedDirections
{
// Tear down animation overlay by sending a swipe end event.
PRUint32 allowedDirectionsCopy = aAllowedDirections;
uint32_t allowedDirectionsCopy = aAllowedDirections;
[self sendSwipeEvent:anEvent
withKind:NS_SIMPLE_GESTURE_SWIPE_END
allowedDirections:&allowedDirectionsCopy
@ -3773,9 +3773,9 @@ NSEvent* gLastDragMouseDownEvent = nil;
return;
}
PRUint32 vDirs = (PRUint32)nsIDOMSimpleGestureEvent::DIRECTION_DOWN |
(PRUint32)nsIDOMSimpleGestureEvent::DIRECTION_UP;
PRUint32 direction = 0;
uint32_t vDirs = (uint32_t)nsIDOMSimpleGestureEvent::DIRECTION_DOWN |
(uint32_t)nsIDOMSimpleGestureEvent::DIRECTION_UP;
uint32_t direction = 0;
// Only initiate horizontal tracking for events whose horizontal element is
// at least eight times larger than its vertical element. This minimizes
// performance problems with vertical scrolls (by minimizing the possibility
@ -3791,9 +3791,9 @@ NSEvent* gLastDragMouseDownEvent = nil;
return;
if (deltaX < 0.0)
direction = (PRUint32)nsIDOMSimpleGestureEvent::DIRECTION_RIGHT;
direction = (uint32_t)nsIDOMSimpleGestureEvent::DIRECTION_RIGHT;
else
direction = (PRUint32)nsIDOMSimpleGestureEvent::DIRECTION_LEFT;
direction = (uint32_t)nsIDOMSimpleGestureEvent::DIRECTION_LEFT;
}
// Only initiate vertical tracking for events whose vertical element is
// at least two times larger than its horizontal element. This minimizes
@ -3801,9 +3801,9 @@ NSEvent* gLastDragMouseDownEvent = nil;
else if (overflowY != 0.0 && deltaY != 0.0 &&
fabsf(deltaY) > fabsf(deltaX) * 2) {
if (deltaY < 0.0)
direction = (PRUint32)nsIDOMSimpleGestureEvent::DIRECTION_DOWN;
direction = (uint32_t)nsIDOMSimpleGestureEvent::DIRECTION_DOWN;
else
direction = (PRUint32)nsIDOMSimpleGestureEvent::DIRECTION_UP;
direction = (uint32_t)nsIDOMSimpleGestureEvent::DIRECTION_UP;
if ((mCurrentSwipeDir & vDirs) && (mCurrentSwipeDir != direction)) {
// If a swipe is currently being tracked kill it -- it's been interrupted
@ -3830,7 +3830,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
mCancelSwipeAnimation = nil;
}
PRUint32 allowedDirections = 0;
uint32_t allowedDirections = 0;
// We're ready to start the animation. Tell Gecko about it, and at the same
// time ask it if it really wants to start an animation for this event.
// This event also reports back the directions that we can swipe in.
@ -3878,7 +3878,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
NSEventPhase phase,
BOOL isComplete,
BOOL *stop) {
PRUint32 allowedDirectionsCopy = allowedDirections;
uint32_t allowedDirectionsCopy = allowedDirections;
// Since this tracking handler can be called asynchronously, mGeckoChild
// might have become NULL here (our child widget might have been
// destroyed).
@ -3913,7 +3913,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
// The animation might continue even after this event was sent, so
// don't tear down the animation overlay yet.
PRUint32 directionCopy = direction;
uint32_t directionCopy = direction;
// gestureAmount is documented to be '-1', '0' or '1' when isComplete
// is TRUE, but the docs don't say anything about its value at other