Skip to content

Commit

Permalink
Bug 579517 - Part 1: Automated conversion of NSPR numeric types to st…
Browse files Browse the repository at this point in the history
…dint 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
  • Loading branch information
ehsan committed Aug 22, 2012
1 parent 5cfd470 commit e368dc9
Show file tree
Hide file tree
Showing 4,098 changed files with 54,940 additions and 54,940 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion accessible/public/nsIAccessibilityService.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class nsIAccessibilityService : public nsIAccessibleRetrieval
* @param aEvent [in] accessible event type
* @param aTarget [in] target of accessible event
*/
virtual void FireAccessibleEvent(PRUint32 aEvent, Accessible* aTarget) = 0;
virtual void FireAccessibleEvent(uint32_t aEvent, Accessible* aTarget) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIAccessibilityService,
Expand Down
8 changes: 4 additions & 4 deletions accessible/public/nsIAccessible.idl
Original file line number Diff line number Diff line change
Expand Up @@ -246,23 +246,23 @@ interface nsIAccessible : nsISupports
/**
* The number of accessible actions associated with this accessible
*/
readonly attribute PRUint8 actionCount;
readonly attribute uint8_t actionCount;

/**
* The name of the accessible action at the given zero-based index
*/
AString getActionName(in PRUint8 index);
AString getActionName(in uint8_t index);

/**
* The description of the accessible action at the given zero-based index
*/
AString getActionDescription(in PRUint8 aIndex);
AString getActionDescription(in uint8_t aIndex);

/**
* Perform the accessible action at the given zero-based index
* Action number 0 is the default action
*/
void doAction(in PRUint8 index);
void doAction(in uint8_t index);

/**
* Makes an object visible on screen.
Expand Down
4 changes: 2 additions & 2 deletions accessible/public/nsIAccessibleText.idl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ interface nsIAccessibleText : nsISupports
// In parameters for character offsets:
// -1 will be treated as the equal to the end of the text
// -2 will be treated as the caret position
const PRInt32 TEXT_OFFSET_END_OF_TEXT = -1;
const PRInt32 TEXT_OFFSET_CARET = -2;
const int32_t TEXT_OFFSET_END_OF_TEXT = -1;
const int32_t TEXT_OFFSET_CARET = -2;

const AccessibleTextBoundary BOUNDARY_CHAR = 0;
const AccessibleTextBoundary BOUNDARY_WORD_START = 1;
Expand Down
64 changes: 32 additions & 32 deletions accessible/src/atk/AccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ struct MaiAtkObjectClass
static guint mai_atk_object_signals [LAST_SIGNAL] = { 0, };

#ifdef MAI_LOGGING
PRInt32 sMaiAtkObjCreated = 0;
PRInt32 sMaiAtkObjDeleted = 0;
int32_t sMaiAtkObjCreated = 0;
int32_t sMaiAtkObjDeleted = 0;
#endif

G_BEGIN_DECLS
Expand Down Expand Up @@ -198,8 +198,8 @@ static AtkRelationSet* refRelationSetCB(AtkObject *aAtkObj);
*/
G_END_DECLS

static GType GetMaiAtkType(PRUint16 interfacesBits);
static const char * GetUniqueMaiAtkTypeName(PRUint16 interfacesBits);
static GType GetMaiAtkType(uint16_t interfacesBits);
static const char * GetUniqueMaiAtkTypeName(uint16_t interfacesBits);

static gpointer parent_class = NULL;

Expand Down Expand Up @@ -232,8 +232,8 @@ mai_atk_object_get_type(void)
}

#ifdef MAI_LOGGING
PRInt32 AccessibleWrap::mAccWrapCreated = 0;
PRInt32 AccessibleWrap::mAccWrapDeleted = 0;
int32_t AccessibleWrap::mAccWrapCreated = 0;
int32_t AccessibleWrap::mAccWrapDeleted = 0;
#endif

AccessibleWrap::
Expand Down Expand Up @@ -363,10 +363,10 @@ AccessibleWrap::GetAtkObject(nsIAccessible* acc)
}

/* private */
PRUint16
uint16_t
AccessibleWrap::CreateMaiInterfaces(void)
{
PRUint16 interfacesBits = 0;
uint16_t interfacesBits = 0;

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

static GType
GetMaiAtkType(PRUint16 interfacesBits)
GetMaiAtkType(uint16_t interfacesBits)
{
GType type;
static const GTypeInfo tinfo = {
Expand Down Expand Up @@ -454,15 +454,15 @@ GetMaiAtkType(PRUint16 interfacesBits)
* gobject limits the number of types that can directly derive from any
* given object type to 4095.
*/
static PRUint16 typeRegCount = 0;
static uint16_t typeRegCount = 0;
if (typeRegCount++ >= 4095) {
return G_TYPE_INVALID;
}
type = g_type_register_static(MAI_TYPE_ATK_OBJECT,
atkTypeName,
&tinfo, GTypeFlags(0));

for (PRUint32 index = 0; index < ArrayLength(atk_if_infos); index++) {
for (uint32_t index = 0; index < ArrayLength(atk_if_infos); index++) {
if (interfacesBits & (1 << index)) {
g_type_add_interface_static(type,
GetAtkTypeForMai((MaiInterfaceType)index),
Expand All @@ -474,9 +474,9 @@ GetMaiAtkType(PRUint16 interfacesBits)
}

static const char*
GetUniqueMaiAtkTypeName(PRUint16 interfacesBits)
GetUniqueMaiAtkTypeName(uint16_t interfacesBits)
{
#define MAI_ATK_TYPE_NAME_LEN (30) /* 10+sizeof(PRUint16)*8/4+1 < 30 */
#define MAI_ATK_TYPE_NAME_LEN (30) /* 10+sizeof(uint16_t)*8/4+1 < 30 */

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

static void
TranslateStates(PRUint64 aState, AtkStateSet* aStateSet)
TranslateStates(uint64_t aState, AtkStateSet* aStateSet)
{

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

PRUint32 relationTypes[] = {
uint32_t relationTypes[] = {
nsIAccessibleRelation::RELATION_LABELLED_BY,
nsIAccessibleRelation::RELATION_LABEL_FOR,
nsIAccessibleRelation::RELATION_NODE_CHILD_OF,
Expand All @@ -910,7 +910,7 @@ refRelationSetCB(AtkObject *aAtkObj)
nsIAccessibleRelation::RELATION_DESCRIPTION_FOR,
};

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

PRUint32 type = aEvent->GetEventType();
uint32_t type = aEvent->GetEventType();

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

Expand Down Expand Up @@ -1062,7 +1062,7 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
if (!caretMoveEvent)
break;

PRInt32 caretOffset = caretMoveEvent->GetCaretOffset();
int32_t caretOffset = caretMoveEvent->GetCaretOffset();

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

PRInt32 rowIndex = tableEvent->GetIndex();
PRInt32 numRows = tableEvent->GetCount();
int32_t rowIndex = tableEvent->GetIndex();
int32_t numRows = tableEvent->GetCount();

g_signal_emit_by_name(atkObj,
"row_inserted",
Expand All @@ -1106,8 +1106,8 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);

PRInt32 rowIndex = tableEvent->GetIndex();
PRInt32 numRows = tableEvent->GetCount();
int32_t rowIndex = tableEvent->GetIndex();
int32_t numRows = tableEvent->GetCount();

g_signal_emit_by_name(atkObj,
"row_deleted",
Expand All @@ -1130,8 +1130,8 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);

PRInt32 colIndex = tableEvent->GetIndex();
PRInt32 numCols = tableEvent->GetCount();
int32_t colIndex = tableEvent->GetIndex();
int32_t numCols = tableEvent->GetCount();

g_signal_emit_by_name(atkObj,
"column_inserted",
Expand All @@ -1147,8 +1147,8 @@ AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);

PRInt32 colIndex = tableEvent->GetIndex();
PRInt32 numCols = tableEvent->GetCount();
int32_t colIndex = tableEvent->GetIndex();
int32_t numCols = tableEvent->GetCount();

g_signal_emit_by_name(atkObj,
"column_deleted",
Expand Down Expand Up @@ -1273,7 +1273,7 @@ AccessibleWrap::FireAtkStateChangeEvent(AccEvent* aEvent,
NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);

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

PRInt32 start = event->GetStartOffset();
PRUint32 length = event->GetLength();
int32_t start = event->GetStartOffset();
uint32_t length = event->GetLength();
bool isInserted = event->IsTextInserted();
bool isFromUserInput = aEvent->IsFromUserInput();
char* signal_name = nullptr;
Expand Down Expand Up @@ -1346,7 +1346,7 @@ AccessibleWrap::FireAtkShowHideEvent(AccEvent* aEvent,
MAI_LOG_DEBUG(("\n\nReceived: Hide event\n"));
}

PRInt32 indexInParent = getIndexInParentCB(aObject);
int32_t indexInParent = getIndexInParentCB(aObject);
AtkObject *parentObject = getParentCB(aObject);
NS_ENSURE_STATE(parentObject);

Expand Down
8 changes: 4 additions & 4 deletions accessible/src/atk/AccessibleWrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ enum AtkProperty {
};

struct AtkPropertyChange {
PRInt32 type; // property type as listed above
int32_t type; // property type as listed above
void *oldvalue;
void *newvalue;
};
Expand All @@ -59,8 +59,8 @@ class AccessibleWrap : public Accessible

#ifdef MAI_LOGGING
virtual void DumpAccessibleWrapInfo(int aDepth) {}
static PRInt32 mAccWrapCreated;
static PRInt32 mAccWrapDeleted;
static int32_t mAccWrapCreated;
static int32_t mAccWrapDeleted;
#endif

// return the atk object for this AccessibleWrap
Expand Down Expand Up @@ -107,7 +107,7 @@ class AccessibleWrap : public Accessible

static EAvailableAtkSignals gAvailableAtkSignals;

PRUint16 CreateMaiInterfaces(void);
uint16_t CreateMaiInterfaces(void);
};

#endif /* __NS_ACCESSIBLE_WRAP_H__ */
10 changes: 5 additions & 5 deletions accessible/src/atk/ApplicationAccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ ApplicationAccessibleWrap::GetNativeInterface(void** aOutAccessible)
struct AtkRootAccessibleAddedEvent {
AtkObject *app_accessible;
AtkObject *root_accessible;
PRUint32 index;
uint32_t index;
};

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

PRUint32 count = mChildren.Length();
uint32_t count = mChildren.Length();

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

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

PRInt16 loc1 = 0, loc2 = 0;
PRInt16 subLen = 0;
int16_t loc1 = 0, loc2 = 0;
int16_t subLen = 0;
while (loc2 >= 0) {
loc2 = libPath.FindChar(':', loc1);
if (loc2 < 0)
Expand Down
2 changes: 1 addition & 1 deletion accessible/src/atk/nsMaiInterfaceComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ getExtentsHelper(AccessibleWrap* aAccWrap,
if (!aAccWrap || aAccWrap->IsDefunct())
return;

PRInt32 x = 0, y = 0, width = 0, height = 0;
int32_t x = 0, y = 0, width = 0, height = 0;
// Returned in screen coordinates
nsresult rv = aAccWrap->GetBounds(&x, &y, &width, &height);
if (NS_FAILED(rv))
Expand Down
2 changes: 1 addition & 1 deletion accessible/src/atk/nsMaiInterfaceEditableText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ insertTextCB(AtkEditableText *aText,

// interface changed in nsIAccessibleEditableText.idl ???
//
// PRInt32 pos = *aPosition;
// int32_t pos = *aPosition;
// nsresult rv = accText->InsertText(strContent, aLength, &pos);
// *aPosition = pos;

Expand Down
2 changes: 1 addition & 1 deletion accessible/src/atk/nsMaiInterfaceHypertext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ getLinkIndexCB(AtkHypertext *aText, gint aCharIndex)
HyperTextAccessible* hyperText = accWrap->AsHyperText();
NS_ENSURE_TRUE(hyperText, -1);

PRInt32 index = -1;
int32_t index = -1;
nsresult rv = hyperText->GetLinkIndexAtOffset(aCharIndex, &index);
NS_ENSURE_SUCCESS(rv, -1);

Expand Down
2 changes: 1 addition & 1 deletion accessible/src/atk/nsMaiInterfaceImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ getImagePositionCB(AtkImage* aImage, gint* aAccX, gint* aAccY,
return;

ImageAccessible* image = accWrap->AsImage();
PRUint32 geckoCoordType = (aCoordType == ATK_XY_WINDOW) ?
uint32_t geckoCoordType = (aCoordType == ATK_XY_WINDOW) ?
nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE :
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
// Returned in screen coordinates
Expand Down
Loading

0 comments on commit e368dc9

Please sign in to comment.