Skip to content

Commit e368dc9

Browse files
author
Ehsan Akhgari
committed
Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script. Here's the source of the script for future reference: function convert() { echo "Converting $1 to $2..." find . ! -wholename "*nsprpub*" \ ! -wholename "*security/nss*" \ ! -wholename "*/.hg*" \ ! -wholename "obj-ff-dbg*" \ ! -name nsXPCOMCID.h \ ! -name prtypes.h \ -type f \ \( -iname "*.cpp" \ -o -iname "*.h" \ -o -iname "*.c" \ -o -iname "*.cc" \ -o -iname "*.idl" \ -o -iname "*.ipdl" \ -o -iname "*.ipdlh" \ -o -iname "*.mm" \) | \ xargs -n 1 sed -i -e "s/\b$1\b/$2/g" } convert PRInt8 int8_t convert PRUint8 uint8_t convert PRInt16 int16_t convert PRUint16 uint16_t convert PRInt32 int32_t convert PRUint32 uint32_t convert PRInt64 int64_t convert PRUint64 uint64_t convert PRIntn int convert PRUintn unsigned convert PRSize size_t convert PROffset32 int32_t convert PROffset64 int64_t convert PRPtrdiff ptrdiff_t convert PRFloat64 double
1 parent 5cfd470 commit e368dc9

File tree

4,098 files changed

+54940
-54940
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,098 files changed

+54940
-54940
lines changed

accessible/public/nsIAccessibilityService.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class nsIAccessibilityService : public nsIAccessibleRetrieval
5353
* @param aEvent [in] accessible event type
5454
* @param aTarget [in] target of accessible event
5555
*/
56-
virtual void FireAccessibleEvent(PRUint32 aEvent, Accessible* aTarget) = 0;
56+
virtual void FireAccessibleEvent(uint32_t aEvent, Accessible* aTarget) = 0;
5757
};
5858

5959
NS_DEFINE_STATIC_IID_ACCESSOR(nsIAccessibilityService,

accessible/public/nsIAccessible.idl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,23 +246,23 @@ interface nsIAccessible : nsISupports
246246
/**
247247
* The number of accessible actions associated with this accessible
248248
*/
249-
readonly attribute PRUint8 actionCount;
249+
readonly attribute uint8_t actionCount;
250250

251251
/**
252252
* The name of the accessible action at the given zero-based index
253253
*/
254-
AString getActionName(in PRUint8 index);
254+
AString getActionName(in uint8_t index);
255255

256256
/**
257257
* The description of the accessible action at the given zero-based index
258258
*/
259-
AString getActionDescription(in PRUint8 aIndex);
259+
AString getActionDescription(in uint8_t aIndex);
260260

261261
/**
262262
* Perform the accessible action at the given zero-based index
263263
* Action number 0 is the default action
264264
*/
265-
void doAction(in PRUint8 index);
265+
void doAction(in uint8_t index);
266266

267267
/**
268268
* Makes an object visible on screen.

accessible/public/nsIAccessibleText.idl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ interface nsIAccessibleText : nsISupports
1717
// In parameters for character offsets:
1818
// -1 will be treated as the equal to the end of the text
1919
// -2 will be treated as the caret position
20-
const PRInt32 TEXT_OFFSET_END_OF_TEXT = -1;
21-
const PRInt32 TEXT_OFFSET_CARET = -2;
20+
const int32_t TEXT_OFFSET_END_OF_TEXT = -1;
21+
const int32_t TEXT_OFFSET_CARET = -2;
2222

2323
const AccessibleTextBoundary BOUNDARY_CHAR = 0;
2424
const AccessibleTextBoundary BOUNDARY_WORD_START = 1;

accessible/src/atk/AccessibleWrap.cpp

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ struct MaiAtkObjectClass
141141
static guint mai_atk_object_signals [LAST_SIGNAL] = { 0, };
142142

143143
#ifdef MAI_LOGGING
144-
PRInt32 sMaiAtkObjCreated = 0;
145-
PRInt32 sMaiAtkObjDeleted = 0;
144+
int32_t sMaiAtkObjCreated = 0;
145+
int32_t sMaiAtkObjDeleted = 0;
146146
#endif
147147

148148
G_BEGIN_DECLS
@@ -198,8 +198,8 @@ static AtkRelationSet* refRelationSetCB(AtkObject *aAtkObj);
198198
*/
199199
G_END_DECLS
200200

201-
static GType GetMaiAtkType(PRUint16 interfacesBits);
202-
static const char * GetUniqueMaiAtkTypeName(PRUint16 interfacesBits);
201+
static GType GetMaiAtkType(uint16_t interfacesBits);
202+
static const char * GetUniqueMaiAtkTypeName(uint16_t interfacesBits);
203203

204204
static gpointer parent_class = NULL;
205205

@@ -232,8 +232,8 @@ mai_atk_object_get_type(void)
232232
}
233233

234234
#ifdef MAI_LOGGING
235-
PRInt32 AccessibleWrap::mAccWrapCreated = 0;
236-
PRInt32 AccessibleWrap::mAccWrapDeleted = 0;
235+
int32_t AccessibleWrap::mAccWrapCreated = 0;
236+
int32_t AccessibleWrap::mAccWrapDeleted = 0;
237237
#endif
238238

239239
AccessibleWrap::
@@ -363,10 +363,10 @@ AccessibleWrap::GetAtkObject(nsIAccessible* acc)
363363
}
364364

365365
/* private */
366-
PRUint16
366+
uint16_t
367367
AccessibleWrap::CreateMaiInterfaces(void)
368368
{
369-
PRUint16 interfacesBits = 0;
369+
uint16_t interfacesBits = 0;
370370

371371
// The Component interface is supported by all accessibles.
372372
interfacesBits |= 1 << MAI_INTERFACE_COMPONENT;
@@ -422,7 +422,7 @@ AccessibleWrap::CreateMaiInterfaces(void)
422422
}
423423

424424
static GType
425-
GetMaiAtkType(PRUint16 interfacesBits)
425+
GetMaiAtkType(uint16_t interfacesBits)
426426
{
427427
GType type;
428428
static const GTypeInfo tinfo = {
@@ -454,15 +454,15 @@ GetMaiAtkType(PRUint16 interfacesBits)
454454
* gobject limits the number of types that can directly derive from any
455455
* given object type to 4095.
456456
*/
457-
static PRUint16 typeRegCount = 0;
457+
static uint16_t typeRegCount = 0;
458458
if (typeRegCount++ >= 4095) {
459459
return G_TYPE_INVALID;
460460
}
461461
type = g_type_register_static(MAI_TYPE_ATK_OBJECT,
462462
atkTypeName,
463463
&tinfo, GTypeFlags(0));
464464

465-
for (PRUint32 index = 0; index < ArrayLength(atk_if_infos); index++) {
465+
for (uint32_t index = 0; index < ArrayLength(atk_if_infos); index++) {
466466
if (interfacesBits & (1 << index)) {
467467
g_type_add_interface_static(type,
468468
GetAtkTypeForMai((MaiInterfaceType)index),
@@ -474,9 +474,9 @@ GetMaiAtkType(PRUint16 interfacesBits)
474474
}
475475

476476
static const char*
477-
GetUniqueMaiAtkTypeName(PRUint16 interfacesBits)
477+
GetUniqueMaiAtkTypeName(uint16_t interfacesBits)
478478
{
479-
#define MAI_ATK_TYPE_NAME_LEN (30) /* 10+sizeof(PRUint16)*8/4+1 < 30 */
479+
#define MAI_ATK_TYPE_NAME_LEN (30) /* 10+sizeof(uint16_t)*8/4+1 < 30 */
480480

481481
static gchar namePrefix[] = "MaiAtkType"; /* size = 10 */
482482
static gchar name[MAI_ATK_TYPE_NAME_LEN + 1];
@@ -848,12 +848,12 @@ getIndexInParentCB(AtkObject *aAtkObj)
848848
}
849849

850850
static void
851-
TranslateStates(PRUint64 aState, AtkStateSet* aStateSet)
851+
TranslateStates(uint64_t aState, AtkStateSet* aStateSet)
852852
{
853853

854854
// Convert every state to an entry in AtkStateMap
855-
PRUint32 stateIndex = 0;
856-
PRUint64 bitMask = 1;
855+
uint32_t stateIndex = 0;
856+
uint64_t bitMask = 1;
857857
while (gAtkStateMap[stateIndex].stateMapEntryType != kNoSuchState) {
858858
if (gAtkStateMap[stateIndex].atkState) { // There's potentially an ATK state for this
859859
bool isStateOn = (aState & bitMask) != 0;
@@ -897,7 +897,7 @@ refRelationSetCB(AtkObject *aAtkObj)
897897
if (!accWrap)
898898
return relation_set;
899899

900-
PRUint32 relationTypes[] = {
900+
uint32_t relationTypes[] = {
901901
nsIAccessibleRelation::RELATION_LABELLED_BY,
902902
nsIAccessibleRelation::RELATION_LABEL_FOR,
903903
nsIAccessibleRelation::RELATION_NODE_CHILD_OF,
@@ -910,7 +910,7 @@ refRelationSetCB(AtkObject *aAtkObj)
910910
nsIAccessibleRelation::RELATION_DESCRIPTION_FOR,
911911
};
912912

913-
for (PRUint32 i = 0; i < ArrayLength(relationTypes); i++) {
913+
for (uint32_t i = 0; i < ArrayLength(relationTypes); i++) {
914914
AtkRelationType atkType = static_cast<AtkRelationType>(relationTypes[i]);
915915
AtkRelation* atkRelation =
916916
atk_relation_set_get_relation_by_type(relation_set, atkType);
@@ -969,7 +969,7 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
969969
Accessible* accessible = aEvent->GetAccessible();
970970
NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
971971

972-
PRUint32 type = aEvent->GetEventType();
972+
uint32_t type = aEvent->GetEventType();
973973

974974
AtkObject* atkObj = AccessibleWrap::GetAtkObject(accessible);
975975

@@ -1062,7 +1062,7 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
10621062
if (!caretMoveEvent)
10631063
break;
10641064

1065-
PRInt32 caretOffset = caretMoveEvent->GetCaretOffset();
1065+
int32_t caretOffset = caretMoveEvent->GetCaretOffset();
10661066

10671067
MAI_LOG_DEBUG(("\n\nCaret postion: %d", caretOffset));
10681068
g_signal_emit_by_name(atkObj,
@@ -1089,8 +1089,8 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
10891089
AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
10901090
NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
10911091

1092-
PRInt32 rowIndex = tableEvent->GetIndex();
1093-
PRInt32 numRows = tableEvent->GetCount();
1092+
int32_t rowIndex = tableEvent->GetIndex();
1093+
int32_t numRows = tableEvent->GetCount();
10941094

10951095
g_signal_emit_by_name(atkObj,
10961096
"row_inserted",
@@ -1106,8 +1106,8 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
11061106
AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
11071107
NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
11081108

1109-
PRInt32 rowIndex = tableEvent->GetIndex();
1110-
PRInt32 numRows = tableEvent->GetCount();
1109+
int32_t rowIndex = tableEvent->GetIndex();
1110+
int32_t numRows = tableEvent->GetCount();
11111111

11121112
g_signal_emit_by_name(atkObj,
11131113
"row_deleted",
@@ -1130,8 +1130,8 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
11301130
AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
11311131
NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
11321132

1133-
PRInt32 colIndex = tableEvent->GetIndex();
1134-
PRInt32 numCols = tableEvent->GetCount();
1133+
int32_t colIndex = tableEvent->GetIndex();
1134+
int32_t numCols = tableEvent->GetCount();
11351135

11361136
g_signal_emit_by_name(atkObj,
11371137
"column_inserted",
@@ -1147,8 +1147,8 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
11471147
AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
11481148
NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
11491149

1150-
PRInt32 colIndex = tableEvent->GetIndex();
1151-
PRInt32 numCols = tableEvent->GetCount();
1150+
int32_t colIndex = tableEvent->GetIndex();
1151+
int32_t numCols = tableEvent->GetCount();
11521152

11531153
g_signal_emit_by_name(atkObj,
11541154
"column_deleted",
@@ -1273,7 +1273,7 @@ AccessibleWrap::FireAtkStateChangeEvent(AccEvent* aEvent,
12731273
NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
12741274

12751275
bool isEnabled = event->IsStateEnabled();
1276-
PRInt32 stateIndex = AtkStateMap::GetStateIndexFor(event->GetState());
1276+
int32_t stateIndex = AtkStateMap::GetStateIndexFor(event->GetState());
12771277
if (stateIndex >= 0) {
12781278
NS_ASSERTION(gAtkStateMap[stateIndex].stateMapEntryType != kNoSuchState,
12791279
"No such state");
@@ -1304,8 +1304,8 @@ AccessibleWrap::FireAtkTextChangedEvent(AccEvent* aEvent,
13041304
AccTextChangeEvent* event = downcast_accEvent(aEvent);
13051305
NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
13061306

1307-
PRInt32 start = event->GetStartOffset();
1308-
PRUint32 length = event->GetLength();
1307+
int32_t start = event->GetStartOffset();
1308+
uint32_t length = event->GetLength();
13091309
bool isInserted = event->IsTextInserted();
13101310
bool isFromUserInput = aEvent->IsFromUserInput();
13111311
char* signal_name = nullptr;
@@ -1346,7 +1346,7 @@ AccessibleWrap::FireAtkShowHideEvent(AccEvent* aEvent,
13461346
MAI_LOG_DEBUG(("\n\nReceived: Hide event\n"));
13471347
}
13481348

1349-
PRInt32 indexInParent = getIndexInParentCB(aObject);
1349+
int32_t indexInParent = getIndexInParentCB(aObject);
13501350
AtkObject *parentObject = getParentCB(aObject);
13511351
NS_ENSURE_STATE(parentObject);
13521352

accessible/src/atk/AccessibleWrap.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ enum AtkProperty {
3636
};
3737

3838
struct AtkPropertyChange {
39-
PRInt32 type; // property type as listed above
39+
int32_t type; // property type as listed above
4040
void *oldvalue;
4141
void *newvalue;
4242
};
@@ -59,8 +59,8 @@ class AccessibleWrap : public Accessible
5959

6060
#ifdef MAI_LOGGING
6161
virtual void DumpAccessibleWrapInfo(int aDepth) {}
62-
static PRInt32 mAccWrapCreated;
63-
static PRInt32 mAccWrapDeleted;
62+
static int32_t mAccWrapCreated;
63+
static int32_t mAccWrapDeleted;
6464
#endif
6565

6666
// return the atk object for this AccessibleWrap
@@ -107,7 +107,7 @@ class AccessibleWrap : public Accessible
107107

108108
static EAvailableAtkSignals gAvailableAtkSignals;
109109

110-
PRUint16 CreateMaiInterfaces(void);
110+
uint16_t CreateMaiInterfaces(void);
111111
};
112112

113113
#endif /* __NS_ACCESSIBLE_WRAP_H__ */

accessible/src/atk/ApplicationAccessibleWrap.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ ApplicationAccessibleWrap::GetNativeInterface(void** aOutAccessible)
690690
struct AtkRootAccessibleAddedEvent {
691691
AtkObject *app_accessible;
692692
AtkObject *root_accessible;
693-
PRUint32 index;
693+
uint32_t index;
694694
};
695695

696696
gboolean fireRootAccessibleAddedCB(gpointer data)
@@ -714,7 +714,7 @@ ApplicationAccessibleWrap::AppendChild(Accessible* aChild)
714714
AtkObject* atkAccessible = AccessibleWrap::GetAtkObject(aChild);
715715
atk_object_set_parent(atkAccessible, mAtkObject);
716716

717-
PRUint32 count = mChildren.Length();
717+
uint32_t count = mChildren.Length();
718718

719719
// Emit children_changed::add in a timeout
720720
// to make sure aRootAccWrap is fully initialized.
@@ -735,7 +735,7 @@ ApplicationAccessibleWrap::AppendChild(Accessible* aChild)
735735
bool
736736
ApplicationAccessibleWrap::RemoveChild(Accessible* aChild)
737737
{
738-
PRInt32 index = aChild->IndexInParent();
738+
int32_t index = aChild->IndexInParent();
739739

740740
AtkObject* atkAccessible = AccessibleWrap::GetAtkObject(aChild);
741741
atk_object_set_parent(atkAccessible, NULL);
@@ -795,8 +795,8 @@ LoadGtkModule(GnomeAccessibilityModule& aModule)
795795
MAI_LOG_DEBUG(("Current Lib path=%s\n", libPath.get()));
796796
PR_FreeLibraryName(curLibPath);
797797

798-
PRInt16 loc1 = 0, loc2 = 0;
799-
PRInt16 subLen = 0;
798+
int16_t loc1 = 0, loc2 = 0;
799+
int16_t subLen = 0;
800800
while (loc2 >= 0) {
801801
loc2 = libPath.FindChar(':', loc1);
802802
if (loc2 < 0)

accessible/src/atk/nsMaiInterfaceComponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ getExtentsHelper(AccessibleWrap* aAccWrap,
7777
if (!aAccWrap || aAccWrap->IsDefunct())
7878
return;
7979

80-
PRInt32 x = 0, y = 0, width = 0, height = 0;
80+
int32_t x = 0, y = 0, width = 0, height = 0;
8181
// Returned in screen coordinates
8282
nsresult rv = aAccWrap->GetBounds(&x, &y, &width, &height);
8383
if (NS_FAILED(rv))

accessible/src/atk/nsMaiInterfaceEditableText.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ insertTextCB(AtkEditableText *aText,
7171

7272
// interface changed in nsIAccessibleEditableText.idl ???
7373
//
74-
// PRInt32 pos = *aPosition;
74+
// int32_t pos = *aPosition;
7575
// nsresult rv = accText->InsertText(strContent, aLength, &pos);
7676
// *aPosition = pos;
7777

accessible/src/atk/nsMaiInterfaceHypertext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ getLinkIndexCB(AtkHypertext *aText, gint aCharIndex)
5858
HyperTextAccessible* hyperText = accWrap->AsHyperText();
5959
NS_ENSURE_TRUE(hyperText, -1);
6060

61-
PRInt32 index = -1;
61+
int32_t index = -1;
6262
nsresult rv = hyperText->GetLinkIndexAtOffset(aCharIndex, &index);
6363
NS_ENSURE_SUCCESS(rv, -1);
6464

accessible/src/atk/nsMaiInterfaceImage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ getImagePositionCB(AtkImage* aImage, gint* aAccX, gint* aAccY,
2525
return;
2626

2727
ImageAccessible* image = accWrap->AsImage();
28-
PRUint32 geckoCoordType = (aCoordType == ATK_XY_WINDOW) ?
28+
uint32_t geckoCoordType = (aCoordType == ATK_XY_WINDOW) ?
2929
nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE :
3030
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
3131
// Returned in screen coordinates

0 commit comments

Comments
 (0)