--- a/calendar/base/public/calIAlarm.idl
+++ b/calendar/base/public/calIAlarm.idl
@@ -112,29 +112,29 @@ interface calIAlarm : nsISupports
attribute AUTF8String summary;
/**
* Manage Attendee for this alarm. Not valid for AUDIO and DISPLAY alarms.
*/
void addAttendee(in calIAttendee aAttendee);
void deleteAttendee(in calIAttendee aAttendee);
void clearAttendees();
- void getAttendees(out PRUint32 count,
+ void getAttendees(out uint32_t count,
[array,size_is(count),retval] out calIAttendee attendees);
/**
* Manage Attachments for this alarm.
* For EMAIL alarms, more than one attachment can be specified.
* For AUDIO alarms, one Attachment can be specified.
* For DISPLAY alarms, attachments are invalid.
*/
void addAttachment(in calIAttachment aAttachment);
void deleteAttachment(in calIAttachment aAttachment);
void clearAttachments();
- void getAttachments(out PRUint32 count,
+ void getAttachments(out uint32_t count,
[array,size_is(count),retval] out calIAttachment attachments);
/**
* The human readable representation of this alarm. Uses locale strings.
*
* @param aItem The item to base the string on. Defaults to an event.
*/
AUTF8String toString([optional] in calIItemBase aItem);
--- a/calendar/base/public/calICalendar.idl
+++ b/calendar/base/public/calICalendar.idl
@@ -500,17 +500,17 @@ interface calICompositeCalendar : calICa
* return it; otherwise return null.
*
* @param aId id of calendar
* @return calendar, or null if none
*/
calICalendar getCalendarById(in AUTF8String aId);
/* return a list of all calendars currently registered */
- void getCalendars(out PRUint32 count,
+ void getCalendars(out uint32_t count,
[array, size_is(count), retval] out calICalendar aCalendars);
/**
* In order for addItem() to be called on this object, it is first necessary
* to set this attribute to specify which underlying calendar the item is
* to be added to.
*/
attribute calICalendar defaultCalendar;
@@ -620,11 +620,11 @@ interface calIOperationListener : nsISup
* @param aItems array of immutable items
*
* Multiple onGetResults might be called
*/
void onGetResult (in calICalendar aCalendar,
in nsresult aStatus,
in nsIIDRef aItemType,
in nsIVariant aDetail,
- in PRUint32 aCount,
+ in uint32_t aCount,
[array, size_is(aCount), iid_is(aItemType)] in nsQIResult aItems );
};
--- a/calendar/base/public/calICalendarACLManager.idl
+++ b/calendar/base/public/calICalendarACLManager.idl
@@ -45,26 +45,26 @@ interface calICalendarACLEntry : nsISupp
/* Whether the user accessing the calendar can add items to it. */
readonly attribute boolean userCanAddItems;
/* Whether the user accessing the calendar can remove items from it. */
readonly attribute boolean userCanDeleteItems;
/* Returns the list of user ids matching the user accessing the
calendar. */
- void getUserAddresses(out PRUint32 aCount,
+ void getUserAddresses(out uint32_t aCount,
[array, size_is(aCount), retval] out wstring aAddresses);
/* Returns the list of instantiated identities for the user accessing the
calendar. */
- void getUserIdentities(out PRUint32 aCount,
+ void getUserIdentities(out uint32_t aCount,
[array, size_is(aCount), retval] out nsIMsgIdentity aIdentities);
/* Returns the list of instantiated identities for the user representing
the calendar owner. */
- void getOwnerIdentities(out PRUint32 aCount,
+ void getOwnerIdentities(out uint32_t aCount,
[array, size_is(aCount), retval] out nsIMsgIdentity aIdentities);
/* Helper method that forces a cleanup of any cache and a reload of the
current entry.
(TODO: should be made asynchronous one day) */
void refresh();
};
--- a/calendar/base/public/calICalendarManager.idl
+++ b/calendar/base/public/calICalendarManager.idl
@@ -12,27 +12,27 @@ interface nsIVariant;
interface calICalendarManagerObserver;
[scriptable, uuid(613fb99f-359c-4a12-9c87-10b2b968f8cd)]
interface calICalendarManager : nsISupports
{
/**
* Gives the number of registered calendars that require network access.
*/
- readonly attribute PRUint32 networkCalendarCount;
+ readonly attribute uint32_t networkCalendarCount;
/***
* Gives the number of registered readonly calendars.
*/
- readonly attribute PRUint32 readOnlyCalendarCount;
+ readonly attribute uint32_t readOnlyCalendarCount;
/**
* Gives the number of registered calendars
*/
- readonly attribute PRUint32 calendarCount;
+ readonly attribute uint32_t calendarCount;
/*
* create a new calendar
* aType is the type ("caldav", "storage", etc)
*/
calICalendar createCalendar(in AUTF8String aType, in nsIURI aURL);
/* register a newly created calendar with the calendar service */
void registerCalendar(in calICalendar aCalendar);
@@ -42,17 +42,17 @@ interface calICalendarManager : nsISuppo
/* delete a calendar for good */
void deleteCalendar(in calICalendar aCalendar);
/* get a calendar by its id */
calICalendar getCalendarById(in AUTF8String aId);
/* return a list of all calendars currently registered */
- void getCalendars(out PRUint32 count,
+ void getCalendars(out uint32_t count,
[array, size_is(count), retval] out calICalendar aCalendars);
/** Add an observer for the calendar manager, i.e when calendars are registered */
void addObserver(in calICalendarManagerObserver aObserver);
/** Remove an observer for the calendar manager */
void removeObserver(in calICalendarManagerObserver aObserver);
/** Add an observer to handle changes to all calendars (even disabled or unchecked ones) */
--- a/calendar/base/public/calICalendarSearchProvider.idl
+++ b/calendar/base/public/calICalendarSearchProvider.idl
@@ -45,17 +45,17 @@ interface calICalendarSearchProvider : n
* Adding a search provider is transient.
*/
[scriptable, uuid(2F2055CA-F558-4dc8-A1D4-11384A00E85C)]
interface calICalendarSearchService : calICalendarSearchProvider
{
/**
* Gets the currently registered set of search providers.
*/
- void getProviders(out PRUint32 aCount,
+ void getProviders(out uint32_t aCount,
[array, size_is(aCount), retval] out calICalendarSearchProvider aProviders);
/**
* Adds a new search provider.
*/
void addProvider(in calICalendarSearchProvider aProvider);
/**
--- a/calendar/base/public/calICalendarView.idl
+++ b/calendar/base/public/calICalendarView.idl
@@ -76,22 +76,22 @@ interface calICalendarView : nsISupports
/**
* If true, the view is zoomable
*/
readonly attribute boolean supportsZoom;
/**
* Zoom view in one level. Defaults to one level.
*/
- void zoomIn([optional] in PRUint32 level);
+ void zoomIn([optional] in uint32_t level);
/**
* Zoom view out one level. Defaults to one level.
*/
- void zoomOut([optional] in PRUint32 level);
+ void zoomOut([optional] in uint32_t level);
/**
* Reset view zoom.
*/
void zoomReset();
/**
* Whether or not completed tasks are shown in the calICalendarView
--- a/calendar/base/public/calICalendarViewController.idl
+++ b/calendar/base/public/calICalendarViewController.idl
@@ -58,14 +58,14 @@ interface calICalendarViewController : n
*
* @param aCount The number of events in the array
* @param aOccurrences An array of Items/Occurrences to delete
* @param aUseParentItems If set, each occurrence will have its parent item
* deleted.
* @param aDoNotConfirm If set, the events will be deleted without
* confirmation.
*/
- void deleteOccurrences (in PRUint32 aCount,
+ void deleteOccurrences (in uint32_t aCount,
[array, size_is(aCount)] in calIItemBase aOccurrences,
in boolean aUseParentItems,
in boolean aDoNotConfirm);
};
--- a/calendar/base/public/calIChangeLog.idl
+++ b/calendar/base/public/calIChangeLog.idl
@@ -95,17 +95,17 @@ interface calISyncWriteCalendar : calICa
*
* @param id an item id
*/
AUTF8String getMetaData(in AUTF8String id);
/**
* Gets all meta data. The returned arrays are of the same length.
*/
- void getAllMetaData(out PRUint32 count,
+ void getAllMetaData(out uint32_t count,
[array, size_is(count)] out wstring ids,
[array, size_is(count)] out wstring values);
};
/**
* Calendar implementing this interface have improved means of replaying their
* changelog data. This could for example mean, that the provider can retrieve
* changes between now and the last sync.
--- a/calendar/base/public/calIDateTime.idl
+++ b/calendar/base/public/calIDateTime.idl
@@ -46,17 +46,17 @@ interface calIDateTime : nsISupports
* @warning: When the timezone is set to 'floating', this will return
* the nativeTime as-if the timezone was UTC. Take this into account
* when comparing values.
*
* @note on objects that are pinned to a timezone and have isDate set,
* nativeTime will be 00:00:00 in the timezone of that date, not 00:00:00 in
* UTC.
*/
- attribute PRInt64 nativeTime;
+ attribute int64_t nativeTime;
/**
* Full 4-digit year value (e.g. "1989", "2004")
*/
attribute short year;
/**
* Month, 0-11, 0 = January
--- a/calendar/base/public/calIICSService.idl
+++ b/calendar/base/public/calIICSService.idl
@@ -32,17 +32,17 @@ interface nsIInputStream;
*/
[scriptable,uuid(c4637c40-3c4c-4ecd-b802-8b5b46bdf5a4)]
interface calIIcalComponent : nsISupports
{
/**
* This is the value that an integer-valued getter will provide if
* there is no such property on the wrapped ical structure.
*/
- const PRInt32 INVALID_VALUE = -1;
+ const int32_t INVALID_VALUE = -1;
/**
* @param kind ANY, XROOT, VCALENDAR, VEVENT, etc.
*/
calIIcalComponent getFirstSubcomponent(in AUTF8String componentType);
calIIcalComponent getNextSubcomponent(in AUTF8String componentType);
readonly attribute AUTF8String componentType;
@@ -62,17 +62,17 @@ interface calIIcalComponent : nsISupport
attribute AUTF8String status;
attribute AUTF8String summary;
attribute AUTF8String description;
attribute AUTF8String location;
attribute AUTF8String categories;
attribute AUTF8String URL;
- attribute PRInt32 priority;
+ attribute int32_t priority;
attribute calIDateTime startTime;
attribute calIDateTime endTime;
readonly attribute calIDuration duration;
attribute calIDateTime dueTime;
attribute calIDateTime stampTime;
attribute calIDateTime createdTime;
@@ -128,17 +128,17 @@ interface calIIcalComponent : nsISupport
*/
void addTimezoneReference(in calITimezone aTimezone);
/**
* Returns an array of VTIMEZONE components.
* These are the timezones that are in use by this
* component and its children.
*/
- void getReferencedTimezones(out PRUint32 aCount,
+ void getReferencedTimezones(out uint32_t aCount,
[array,size_is(aCount),retval] out calITimezone aTimezones);
/**
* Clones the component. The cloned component is decoupled from any parent.
* @return cloned component
*/
calIIcalComponent clone();
--- a/calendar/base/public/calIIcsParser.idl
+++ b/calendar/base/public/calIIcsParser.idl
@@ -69,44 +69,44 @@ interface calIIcsParser : nsISupports
* Please keep in mind that any parentless items (see below) are not contained
* in the returned set of items.
*
* @param aCount
* Will hold the number of items that were parsed
* @param aItems
* The items
*/
- void getItems(out PRUint32 aCount,
+ void getItems(out uint32_t aCount,
[array,size_is(aCount),retval] out calIItemBase aItems);
/**
* Get the parentless items that may have occurred, i.e. overridden items of a
* recurring series (having a RECURRENCE-ID) missing their parent item in the
* parsed content.
*
* @param aCount
* Will hold the number of items that were parsed
* @param aItems
* The items
*/
- void getParentlessItems(out PRUint32 aCount,
+ void getParentlessItems(out uint32_t aCount,
[array,size_is(aCount),retval] out calIItemBase aItems);
/**
* Get the top-level properties that were not interpreted as anything special
* @param aCount
* Will hold the number of properties that were found
* @param aProperties
* The properties
*/
- void getProperties(out PRUint32 aCount,
+ void getProperties(out uint32_t aCount,
[array,size_is(aCount),retval] out calIIcalProperty aProperties);
/**
* Get the top-level components that were not interpreted as anything special
* @param aCount
* Will hold the number of components that were found
* @param aComponents
* The components
*/
- void getComponents(out PRUint32 aCount,
+ void getComponents(out uint32_t aCount,
[array,size_is(aCount),retval] out calIIcalComponent aComponents);
};
--- a/calendar/base/public/calIItemBase.idl
+++ b/calendar/base/public/calIItemBase.idl
@@ -64,17 +64,17 @@ interface calIItemBase : nsISupports
/**
* Returns the acl entry associated to the item.
*/
readonly attribute calIItemACLEntry aclEntry;
//
// the generation number of this item
//
- attribute PRUint32 generation;
+ attribute uint32_t generation;
// the time when this item was created
readonly attribute calIDateTime creationDate;
// last time any attribute was modified on this item, in UTC
readonly attribute calIDateTime lastModifiedTime;
// last time a "significant change" was made to this item
@@ -110,17 +110,17 @@ interface calIItemBase : nsISupports
//
/**
* Get all alarms assigned to this item
*
* @param count The number of alarms
* @param aAlarms The array of calIAlarms
*/
- void getAlarms(out PRUint32 count, [array, size_is(count), retval] out calIAlarm aAlarms);
+ void getAlarms(out uint32_t count, [array, size_is(count), retval] out calIAlarm aAlarms);
/**
* Add an alarm to the item
*
* @param aAlarm The calIAlarm to add
*/
void addAlarm(in calIAlarm aAlarm);
@@ -254,63 +254,63 @@ interface calIItemBase : nsISupports
attribute calIAttendee organizer;
//
// Attendees
//
// The array returned here is not live; it will not reflect calls to
// removeAttendee/addAttendee that follow the call to getAttendees.
- void getAttendees(out PRUint32 count,
+ void getAttendees(out uint32_t count,
[array,size_is(count),retval] out calIAttendee attendees);
/**
* getAttendeeById's matching is done in a case-insensitive manner to handle
* places where "MAILTO:" or similar properties are capitalized arbitrarily
* by different calendar clients.
*/
calIAttendee getAttendeeById(in AUTF8String id);
void addAttendee(in calIAttendee attendee);
void removeAttendee(in calIAttendee attendee);
void removeAllAttendees();
//
// Attachments
//
- void getAttachments(out PRUint32 count,
+ void getAttachments(out uint32_t count,
[array,size_is(count),retval] out calIAttachment attachments);
void addAttachment(in calIAttachment attachment);
void removeAttachment(in calIAttachment attachment);
void removeAllAttachments();
//
// Categories
//
/**
* Gets the array of categories this item belongs to.
*/
- void getCategories(out PRUint32 aCount,
+ void getCategories(out uint32_t aCount,
[array, size_is(aCount), retval] out wstring aCategories);
/**
* Sets the array of categories this item belongs to.
*/
- void setCategories(in PRUint32 aCount,
+ void setCategories(in uint32_t aCount,
[array, size_is(aCount)] in wstring aCategories);
//
// Relations
//
/**
* This gives back every relation where the item is neighter the owner of the
* relation nor the referred relation
*/
- void getRelations(out PRUint32 count,
+ void getRelations(out uint32_t count,
[array,size_is(count),retval] out calIRelation relations);
/**
* Adds a relation to the item
*/
void addRelation(in calIRelation relation);
/**
@@ -326,17 +326,17 @@ interface calIItemBase : nsISupports
// Occurrence querying
//
/**
* Return a list of occurrences of this item between the given dates. The items
* returned are the same type as this one, as proxies.
*/
void getOccurrencesBetween (in calIDateTime aStartDate, in calIDateTime aEndDate,
- out PRUint32 aCount,
+ out uint32_t aCount,
[array,size_is(aCount),retval] out calIItemBase aOccurrences);
/**
* If this item is a proxy or overridden item, parentItem will point upwards
* to our parent. Otherwise, it will point to this.
* parentItem can thus always be used for modifyItem() calls
* to providers.
*/
--- a/calendar/base/public/calIItipTransport.idl
+++ b/calendar/base/public/calIItipTransport.idl
@@ -37,12 +37,12 @@ interface calIItipTransport : nsISupport
* alternative representation. If a calIItipItem is attached, then an ICS
* representation of those objects are generated and attached to the email.
* If the calIItipItem is null, then the item(s) is sent without any
* text/calendar mime part.
* @param count size of recipient array
* @param recipientArray array of recipients
* @param calIItipItem set of calIItems encapsulated as calIItipItems
*/
- void sendItems(in PRUint32 count,
+ void sendItems(in uint32_t count,
[array, size_is(count)] in calIAttendee recipientArray,
in calIItipItem item);
};
--- a/calendar/base/src/calDateTime.cpp
+++ b/calendar/base/src/calDateTime.cpp
@@ -61,22 +61,22 @@ calDateTime::Clone(calIDateTime **aResul
ToIcalTime(&itt);
calDateTime * const cdt = new calDateTime(&itt, mTimezone);
CAL_ENSURE_MEMORY(cdt);
NS_ADDREF(*aResult = cdt);
return NS_OK;
}
NS_IMETHODIMP
-calDateTime::ResetTo(PRInt16 year,
- PRInt16 month,
- PRInt16 day,
- PRInt16 hour,
- PRInt16 minute,
- PRInt16 second,
+calDateTime::ResetTo(int16_t year,
+ int16_t month,
+ int16_t day,
+ int16_t hour,
+ int16_t minute,
+ int16_t second,
calITimezone * tz)
{
NS_ENSURE_FALSE(mImmutable, NS_ERROR_OBJECT_IS_IMMUTABLE);
NS_ENSURE_ARG_POINTER(tz);
mYear = year;
mMonth = month;
mDay = day;
mHour = hour;
@@ -102,27 +102,27 @@ calDateTime::Reset()
mYearday = 1;
mIsDate = false;
mTimezone = nullptr;
mNativeTime = 0;
mIsValid = true;
return NS_OK;
}
-CAL_VALUETYPE_ATTR(calDateTime, PRInt16, Year)
-CAL_VALUETYPE_ATTR(calDateTime, PRInt16, Month)
-CAL_VALUETYPE_ATTR(calDateTime, PRInt16, Day)
-CAL_VALUETYPE_ATTR(calDateTime, PRInt16, Hour)
-CAL_VALUETYPE_ATTR(calDateTime, PRInt16, Minute)
-CAL_VALUETYPE_ATTR(calDateTime, PRInt16, Second)
+CAL_VALUETYPE_ATTR(calDateTime, int16_t, Year)
+CAL_VALUETYPE_ATTR(calDateTime, int16_t, Month)
+CAL_VALUETYPE_ATTR(calDateTime, int16_t, Day)
+CAL_VALUETYPE_ATTR(calDateTime, int16_t, Hour)
+CAL_VALUETYPE_ATTR(calDateTime, int16_t, Minute)
+CAL_VALUETYPE_ATTR(calDateTime, int16_t, Second)
CAL_VALUETYPE_ATTR(calDateTime, bool, IsDate)
CAL_VALUETYPE_ATTR_GETTER(calDateTime, bool, IsValid)
CAL_VALUETYPE_ATTR_GETTER(calDateTime, PRTime, NativeTime)
-CAL_VALUETYPE_ATTR_GETTER(calDateTime, PRInt16, Weekday)
-CAL_VALUETYPE_ATTR_GETTER(calDateTime, PRInt16, Yearday)
+CAL_VALUETYPE_ATTR_GETTER(calDateTime, int16_t, Weekday)
+CAL_VALUETYPE_ATTR_GETTER(calDateTime, int16_t, Yearday)
NS_IMETHODIMP
calDateTime::GetTimezone(calITimezone **aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
ensureTimezone();
@@ -136,17 +136,17 @@ calDateTime::SetTimezone(calITimezone *a
NS_ENSURE_FALSE(mImmutable, NS_ERROR_OBJECT_IS_IMMUTABLE);
NS_ENSURE_ARG_POINTER(aValue);
mTimezone = aValue;
CAL_ATTR_SET_POST;
return NS_OK;
}
NS_IMETHODIMP
-calDateTime::GetTimezoneOffset(PRInt32 *aResult)
+calDateTime::GetTimezoneOffset(int32_t *aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
icaltimetype icalt;
ToIcalTime(&icalt);
int dst;
*aResult = icaltimezone_get_utc_offset(const_cast<icaltimezone *>(icalt.zone), &icalt, &dst);
return NS_OK;
}
@@ -186,38 +186,38 @@ calDateTime::SubtractDate(calIDateTime *
NS_ENSURE_ARG_POINTER(aDuration);
// same as icaltime_subtract(), but minding timezones:
PRTime t2t;
aDate->GetNativeTime(&t2t);
// for a duration, need to convert the difference in microseconds (prtime)
// to seconds (libical), so divide by one million.
icaldurationtype const idt = icaldurationtype_from_int(
- static_cast<int>((mNativeTime - t2t) / PRInt64(PR_USEC_PER_SEC)));
+ static_cast<int>((mNativeTime - t2t) / int64_t(PR_USEC_PER_SEC)));
calDuration * const dur = new calDuration(&idt);
CAL_ENSURE_MEMORY(dur);
NS_ADDREF(*aDuration = dur);
return NS_OK;
}
NS_IMETHODIMP
calDateTime::ToString(nsACString & aResult)
{
nsCAutoString tzid;
char buffer[256];
ensureTimezone();
mTimezone->GetTzid(tzid);
- PRUint32 const length = PR_snprintf(
+ uint32_t const length = PR_snprintf(
buffer, sizeof(buffer), "%04hd/%02hd/%02hd %02hd:%02hd:%02hd %s isDate=%01hd nativeTime=%lld",
mYear, mMonth + 1, mDay, mHour, mMinute, mSecond,
- tzid.get(), static_cast<PRInt16>(mIsDate), mNativeTime);
- if (length != static_cast<PRUint32>(-1))
+ tzid.get(), static_cast<int16_t>(mIsDate), mNativeTime);
+ if (length != static_cast<uint32_t>(-1))
aResult.Assign(buffer, length);
return NS_OK;
}
NS_IMETHODIMP
calDateTime::SetTimeInTimezone(PRTime aTime, calITimezone * aTimezone)
{
NS_ENSURE_FALSE(mImmutable, NS_ERROR_OBJECT_IS_IMMUTABLE);
@@ -459,22 +459,22 @@ void calDateTime::FromIcalTime(icaltimet
t.minute = 0;
t.second = 0;
}
if (mIsValid) {
t = icaltime_normalize(t);
}
- mYear = static_cast<PRInt16>(t.year);
- mMonth = static_cast<PRInt16>(t.month - 1);
- mDay = static_cast<PRInt16>(t.day);
- mHour = static_cast<PRInt16>(t.hour);
- mMinute = static_cast<PRInt16>(t.minute);
- mSecond = static_cast<PRInt16>(t.second);
+ mYear = static_cast<int16_t>(t.year);
+ mMonth = static_cast<int16_t>(t.month - 1);
+ mDay = static_cast<int16_t>(t.day);
+ mHour = static_cast<int16_t>(t.hour);
+ mMinute = static_cast<int16_t>(t.minute);
+ mSecond = static_cast<int16_t>(t.second);
if (tz) {
mTimezone = tz;
} else {
mTimezone = cal::detectTimezone(t, nullptr);
}
#if defined(DEBUG)
if (mTimezone) {
@@ -490,18 +490,18 @@ void calDateTime::FromIcalTime(icaltimet
nsCAutoString tzid;
mTimezone->GetTzid(tzid);
NS_ASSERTION(tzid.Equals(icaltimezone_get_tzid(const_cast<icaltimezone *>(t.zone))),
"tzid mismatch!");
}
}
#endif
- mWeekday = static_cast<PRInt16>(icaltime_day_of_week(t) - 1);
- mYearday = static_cast<PRInt16>(icaltime_day_of_year(t));
+ mWeekday = static_cast<int16_t>(icaltime_day_of_week(t) - 1);
+ mYearday = static_cast<int16_t>(icaltime_day_of_year(t));
// mNativeTime: not moving the existing date to UTC,
// but merely representing it a UTC-based way.
t.is_date = 0;
mNativeTime = IcaltimeToPRTime(&t, icaltimezone_get_utc_timezone());
}
PRTime calDateTime::IcaltimeToPRTime(icaltimetype const* icalt, icaltimezone const* tz)
@@ -528,19 +528,19 @@ PRTime calDateTime::IcaltimeToPRTime(ica
/* Fill the fields */
if (icaltime_is_date(tt)) {
et.tm_sec = et.tm_min = et.tm_hour = 0;
} else {
et.tm_sec = tt.second;
et.tm_min = tt.minute;
et.tm_hour = tt.hour;
}
- et.tm_mday = static_cast<PRInt16>(tt.day);
- et.tm_month = static_cast<PRInt16>(tt.month-1);
- et.tm_year = static_cast<PRInt16>(tt.year);
+ et.tm_mday = static_cast<int16_t>(tt.day);
+ et.tm_month = static_cast<int16_t>(tt.month-1);
+ et.tm_year = static_cast<int16_t>(tt.year);
return PR_ImplodeTime(&et);
}
void calDateTime::PRTimeToIcaltime(PRTime time, bool isdate,
icaltimezone const* tz,
icaltimetype * icalt)
{
@@ -568,17 +568,17 @@ void calDateTime::PRTimeToIcaltime(PRTim
icalt->is_daylight = 0;
// xxx todo: discuss/investigate is_daylight
// if (tz) {
// icaltimezone_get_utc_offset(tz, icalt, &icalt->is_daylight);
// }
}
NS_IMETHODIMP
-calDateTime::Compare(calIDateTime * aOther, PRInt32 * aResult)
+calDateTime::Compare(calIDateTime * aOther, int32_t * aResult)
{
NS_ENSURE_ARG_POINTER(aOther);
NS_ENSURE_ARG_POINTER(aResult);
bool otherIsDate = false;
aOther->GetIsDate(&otherIsDate);
icaltimetype a, b;
--- a/calendar/base/src/calDateTime.h
+++ b/calendar/base/src/calDateTime.h
@@ -21,24 +21,24 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_CALIDATETIME
protected:
bool mImmutable;
bool mIsValid;
bool mIsDate;
- PRInt16 mYear;
- PRInt16 mMonth;
- PRInt16 mDay;
- PRInt16 mHour;
- PRInt16 mMinute;
- PRInt16 mSecond;
- PRInt16 mWeekday;
- PRInt16 mYearday;
+ int16_t mYear;
+ int16_t mMonth;
+ int16_t mDay;
+ int16_t mHour;
+ int16_t mMinute;
+ int16_t mSecond;
+ int16_t mWeekday;
+ int16_t mYearday;
PRTime mNativeTime;
nsCOMPtr<calITimezone> mTimezone;
void Normalize();
void FromIcalTime(icaltimetype const* icalt, calITimezone *tz);
void ensureTimezone();
--- a/calendar/base/src/calDuration.cpp
+++ b/calendar/base/src/calDuration.cpp
@@ -96,92 +96,92 @@ NS_IMETHODIMP calDuration::GetIsNegative
}
NS_IMETHODIMP calDuration::SetIsNegative(bool aValue)
{
if (mImmutable) return NS_ERROR_CALENDAR_IMMUTABLE;
mDuration.is_neg = aValue;
return NS_OK;
}
-NS_IMETHODIMP calDuration::GetWeeks(PRInt16 *_retval)
+NS_IMETHODIMP calDuration::GetWeeks(int16_t *_retval)
{
- *_retval = (PRInt16)mDuration.weeks;
+ *_retval = (int16_t)mDuration.weeks;
return NS_OK;
}
-NS_IMETHODIMP calDuration::SetWeeks(PRInt16 aValue)
+NS_IMETHODIMP calDuration::SetWeeks(int16_t aValue)
{
if (mImmutable) return NS_ERROR_CALENDAR_IMMUTABLE;
mDuration.weeks = aValue;
return NS_OK;
}
-NS_IMETHODIMP calDuration::GetDays(PRInt16 *_retval)
+NS_IMETHODIMP calDuration::GetDays(int16_t *_retval)
{
- *_retval = (PRInt16)mDuration.days;
+ *_retval = (int16_t)mDuration.days;
return NS_OK;
}
-NS_IMETHODIMP calDuration::SetDays(PRInt16 aValue)
+NS_IMETHODIMP calDuration::SetDays(int16_t aValue)
{
if (mImmutable) return NS_ERROR_CALENDAR_IMMUTABLE;
mDuration.days = aValue;
return NS_OK;
}
-NS_IMETHODIMP calDuration::GetHours(PRInt16 *_retval)
+NS_IMETHODIMP calDuration::GetHours(int16_t *_retval)
{
- *_retval = (PRInt16)mDuration.hours;
+ *_retval = (int16_t)mDuration.hours;
return NS_OK;
}
-NS_IMETHODIMP calDuration::SetHours(PRInt16 aValue)
+NS_IMETHODIMP calDuration::SetHours(int16_t aValue)
{
if (mImmutable) return NS_ERROR_CALENDAR_IMMUTABLE;
mDuration.hours = aValue;
return NS_OK;
}
-NS_IMETHODIMP calDuration::GetMinutes(PRInt16 *_retval)
+NS_IMETHODIMP calDuration::GetMinutes(int16_t *_retval)
{
- *_retval = (PRInt16)mDuration.minutes;
+ *_retval = (int16_t)mDuration.minutes;
return NS_OK;
}
-NS_IMETHODIMP calDuration::SetMinutes(PRInt16 aValue)
+NS_IMETHODIMP calDuration::SetMinutes(int16_t aValue)
{
if (mImmutable) return NS_ERROR_CALENDAR_IMMUTABLE;
mDuration.minutes = aValue;
return NS_OK;
}
-NS_IMETHODIMP calDuration::GetSeconds(PRInt16 *_retval)
+NS_IMETHODIMP calDuration::GetSeconds(int16_t *_retval)
{
- *_retval = (PRInt16)mDuration.seconds;
+ *_retval = (int16_t)mDuration.seconds;
return NS_OK;
}
-NS_IMETHODIMP calDuration::SetSeconds(PRInt16 aValue)
+NS_IMETHODIMP calDuration::SetSeconds(int16_t aValue)
{
if (mImmutable) return NS_ERROR_CALENDAR_IMMUTABLE;
mDuration.seconds = aValue;
return NS_OK;
}
-NS_IMETHODIMP calDuration::GetInSeconds(PRInt32 *_retval)
+NS_IMETHODIMP calDuration::GetInSeconds(int32_t *_retval)
{
- PRInt32 retval =
- (((PRInt32)((PRInt16)mDuration.weeks * SECONDS_PER_WEEK)) +
- ((PRInt32)((PRInt16)mDuration.days * SECONDS_PER_DAY)) +
- ((PRInt32)((PRInt16)mDuration.hours * SECONDS_PER_HOUR)) +
- ((PRInt32)((PRInt16)mDuration.minutes * SECONDS_PER_MINUTE)) +
- ((PRInt32)((PRInt16)mDuration.seconds)));
+ int32_t retval =
+ (((int32_t)((int16_t)mDuration.weeks * SECONDS_PER_WEEK)) +
+ ((int32_t)((int16_t)mDuration.days * SECONDS_PER_DAY)) +
+ ((int32_t)((int16_t)mDuration.hours * SECONDS_PER_HOUR)) +
+ ((int32_t)((int16_t)mDuration.minutes * SECONDS_PER_MINUTE)) +
+ ((int32_t)((int16_t)mDuration.seconds)));
if (mDuration.is_neg)
retval=-retval;
*_retval = retval;
return NS_OK;
}
-NS_IMETHODIMP calDuration::SetInSeconds(PRInt32 aValue)
+NS_IMETHODIMP calDuration::SetInSeconds(int32_t aValue)
{
if (mImmutable) return NS_ERROR_CALENDAR_IMMUTABLE;
mDuration.is_neg = (aValue < 0);
if (mDuration.is_neg)
aValue = -aValue;
// set weeks exOR days/hours/...
@@ -234,17 +234,17 @@ NS_IMETHODIMP calDuration::AddDuration(c
}
NS_IMETHODIMP
calDuration::Normalize()
{
if (mImmutable)
return NS_ERROR_CALENDAR_IMMUTABLE;
- PRInt32 totalInSeconds;
+ int32_t totalInSeconds;
GetInSeconds(&totalInSeconds);
SetInSeconds(totalInSeconds);
return NS_OK;
}
NS_IMETHODIMP
calDuration::ToString(nsACString& aResult)
@@ -293,19 +293,19 @@ calDuration::GetIcalString(nsACString& a
NS_IMETHODIMP
calDuration::SetIcalString(const nsACString& aIcalString)
{
mDuration = icaldurationtype_from_string(PromiseFlatCString(aIcalString).get());
return NS_OK;
}
NS_IMETHODIMP
-calDuration::Compare(calIDuration *aOther, PRInt32 *aResult)
+calDuration::Compare(calIDuration *aOther, int32_t *aResult)
{
- PRInt32 thisInSeconds, otherInSeconds;
+ int32_t thisInSeconds, otherInSeconds;
// cast to void because these calls can't fail
(void)GetInSeconds(&thisInSeconds);
(void)aOther->GetInSeconds(&otherInSeconds);
if ( thisInSeconds < otherInSeconds ) {
*aResult = -1;
} else if ( thisInSeconds > otherInSeconds ) {
--- a/calendar/base/src/calICSService.cpp
+++ b/calendar/base/src/calICSService.cpp
@@ -486,22 +486,22 @@ TimezoneHashToTimezoneArray(nsACString c
{
calITimezone *** const arrayPtr = static_cast<calITimezone ***>(arg);
NS_ADDREF(**arrayPtr = tz);
++(*arrayPtr);
return PL_DHASH_NEXT;
}
NS_IMETHODIMP
-calIcalComponent::GetReferencedTimezones(PRUint32 * aCount, calITimezone *** aTimezones)
+calIcalComponent::GetReferencedTimezones(uint32_t * aCount, calITimezone *** aTimezones)
{
NS_ENSURE_ARG_POINTER(aCount);
NS_ENSURE_ARG_POINTER(aTimezones);
- PRUint32 const count = mReferencedTimezones.Count();
+ uint32_t const count = mReferencedTimezones.Count();
if (count == 0) {
*aCount = 0;
*aTimezones = nullptr;
return NS_OK;
}
calITimezone ** const timezones = static_cast<calITimezone **>(
nsMemory::Alloc(sizeof(calITimezone *) * count));
@@ -542,17 +542,17 @@ calIcalComponent::SetProperty(icalproper
icalcomponent_add_property(mComponent, prop);
return NS_OK;
}
#define COMP_STRING_TO_ENUM_ATTRIBUTE(Attrname, ICALNAME, lcname) \
NS_IMETHODIMP \
calIcalComponent::Get##Attrname(nsACString &str) \
{ \
- PRInt32 val; \
+ int32_t val; \
nsresult rv = GetIntProperty(ICAL_##ICALNAME##_PROPERTY, &val); \
if (NS_FAILED(rv)) \
return rv; \
if (val == -1) { \
str.Truncate(); \
str.SetIsVoid(true); \
} else { \
str.Assign(icalproperty_##lcname##_to_string((icalproperty_##lcname)val)); \
@@ -599,51 +599,51 @@ calIcalComponent::Set##Attrname(const ns
{ \
icalproperty *prop = \
icalproperty_new_##lcname(PromiseFlatCString(str).get()); \
return SetProperty(ICAL_##ICALNAME##_PROPERTY, prop); \
}
#define COMP_GENERAL_INT_ATTRIBUTE(Attrname, ICALNAME) \
NS_IMETHODIMP \
-calIcalComponent::Get##Attrname(PRInt32 *valp) \
+calIcalComponent::Get##Attrname(int32_t *valp) \
{ \
return GetIntProperty(ICAL_##ICALNAME##_PROPERTY, valp); \
} \
\
NS_IMETHODIMP \
-calIcalComponent::Set##Attrname(PRInt32 val) \
+calIcalComponent::Set##Attrname(int32_t val) \
{ \
return SetIntProperty(ICAL_##ICALNAME##_PROPERTY, val); \
}
#define COMP_ENUM_ATTRIBUTE(Attrname, ICALNAME, lcname) \
NS_IMETHODIMP \
-calIcalComponent::Get##Attrname(PRInt32 *valp) \
+calIcalComponent::Get##Attrname(int32_t *valp) \
{ \
return GetIntProperty(ICAL_##ICALNAME##_PROPERTY, valp); \
} \
\
NS_IMETHODIMP \
-calIcalComponent::Set##Attrname(PRInt32 val) \
+calIcalComponent::Set##Attrname(int32_t val) \
{ \
icalproperty *prop = \
icalproperty_new_##lcname((icalproperty_##lcname)val); \
return SetProperty(ICAL_##ICALNAME##_PROPERTY, prop); \
}
#define COMP_INT_ATTRIBUTE(Attrname, ICALNAME, lcname) \
NS_IMETHODIMP \
-calIcalComponent::Get##Attrname(PRInt32 *valp) \
+calIcalComponent::Get##Attrname(int32_t *valp) \
{ \
return GetIntProperty(ICAL_##ICALNAME##_PROPERTY, valp); \
} \
\
NS_IMETHODIMP \
-calIcalComponent::Set##Attrname(PRInt32 val) \
+calIcalComponent::Set##Attrname(int32_t val) \
{ \
icalproperty *prop = icalproperty_new_##lcname(val); \
return SetProperty(ICAL_##ICALNAME##_PROPERTY, prop); \
}
nsresult calIcalComponent::GetStringProperty(icalproperty_kind kind, nsACString &str)
{
icalproperty *prop = icalcomponent_get_first_property(mComponent, kind);
@@ -663,27 +663,27 @@ nsresult calIcalComponent::SetStringProp
if (!str.IsVoid()) {
val = icalvalue_new_string(PromiseFlatCString(str).get());
if (!val)
return NS_ERROR_OUT_OF_MEMORY;
}
return SetPropertyValue(kind, val);
}
-nsresult calIcalComponent::GetIntProperty(icalproperty_kind kind, PRInt32 *valp)
+nsresult calIcalComponent::GetIntProperty(icalproperty_kind kind, int32_t *valp)
{
icalproperty *prop = icalcomponent_get_first_property(mComponent, kind);
if (!prop)
*valp = calIIcalComponent::INVALID_VALUE;
else
- *valp = (PRInt32)icalvalue_get_integer(icalproperty_get_value(prop));
+ *valp = (int32_t)icalvalue_get_integer(icalproperty_get_value(prop));
return NS_OK;
}
-nsresult calIcalComponent::SetIntProperty(icalproperty_kind kind, PRInt32 i)
+nsresult calIcalComponent::SetIntProperty(icalproperty_kind kind, int32_t i)
{
icalvalue *val = icalvalue_new_integer(i);
if (!val)
return NS_ERROR_OUT_OF_MEMORY;
return SetPropertyValue(kind, val);
}
nsresult calIcalComponent::GetDateTimeAttribute(icalproperty_kind kind,
@@ -1035,24 +1035,24 @@ calIcalComponent::AddSubcomponent(calIIc
* own objects, and if not
* - use comp->serializeToICS and reparse to create a copy.
*
* I should probably also return the new/reused component so that the
* caller has something it can poke at all live-like.
*/
calIcalComponent * const ical = toIcalComponent(comp);
- PRUint32 tzCount = 0;
+ uint32_t tzCount = 0;
calITimezone ** timezones = nullptr;
nsresult rv = ical->GetReferencedTimezones(&tzCount, &timezones);
NS_ENSURE_SUCCESS(rv, rv);
calIcalComponent * const vcal = getParentVCalendarOrThis();
bool failed = false;
- for (PRUint32 i = 0; i < tzCount; i++) {
+ for (uint32_t i = 0; i < tzCount; i++) {
if (!failed) {
rv = vcal->AddTimezoneReference(timezones[i]);
if (NS_FAILED(rv))
failed = true;
}
NS_RELEASE(timezones[i]);
}
--- a/calendar/base/src/calICSService.h
+++ b/calendar/base/src/calICSService.h
@@ -145,18 +145,18 @@ protected:
nsresult SetDateTimeAttribute(icalproperty_kind kind, calIDateTime * dt);
nsresult SetPropertyValue(icalproperty_kind kind, icalvalue *val);
nsresult SetProperty(icalproperty_kind kind, icalproperty *prop);
nsresult GetStringProperty(icalproperty_kind kind, nsACString &str);
nsresult SetStringProperty(icalproperty_kind kind, const nsACString &str);
- nsresult GetIntProperty(icalproperty_kind kind, PRInt32 *valp);
- nsresult SetIntProperty(icalproperty_kind kind, PRInt32 i);
+ nsresult GetIntProperty(icalproperty_kind kind, int32_t *valp);
+ nsresult SetIntProperty(icalproperty_kind kind, int32_t i);
void ClearAllProperties(icalproperty_kind kind);
nsresult Serialize(char ** icalstr);
nsInterfaceHashtable<nsCStringHashKey, calITimezone> mReferencedTimezones;
icalcomponent * mComponent;
icaltimezone * mTimezone; // set iff VTIMEZONE
--- a/calendar/base/src/calRecurrenceDate.cpp
+++ b/calendar/base/src/calRecurrenceDate.cpp
@@ -118,38 +118,38 @@ calRecurrenceDate::GetNextOccurrence(cal
calIDateTime *aOccurrenceTime,
calIDateTime **_retval)
{
NS_ENSURE_ARG_POINTER(aStartTime);
NS_ENSURE_ARG_POINTER(aOccurrenceTime);
NS_ENSURE_ARG_POINTER(_retval);
if (mDate) {
- PRInt32 result;
+ int32_t result;
if (NS_SUCCEEDED(mDate->Compare(aStartTime, &result)) && result > 0) {
NS_ADDREF (*_retval = mDate);
return NS_OK;
}
}
*_retval = nullptr;
return NS_OK;
}
NS_IMETHODIMP
calRecurrenceDate::GetOccurrences(calIDateTime *aStartTime,
calIDateTime *aRangeStart,
calIDateTime *aRangeEnd,
- PRUint32 aMaxCount,
- PRUint32 *aCount, calIDateTime ***aDates)
+ uint32_t aMaxCount,
+ uint32_t *aCount, calIDateTime ***aDates)
{
NS_ENSURE_ARG_POINTER(aStartTime);
NS_ENSURE_ARG_POINTER(aRangeStart);
- PRInt32 r1, r2;
+ int32_t r1, r2;
if (mDate) {
if (NS_SUCCEEDED(mDate->Compare(aRangeStart, &r1)) && r1 >= 0 &&
(!aRangeEnd || (NS_SUCCEEDED(mDate->Compare(aRangeEnd, &r2)) && r2 < 0)))
{
calIDateTime **dates = (calIDateTime **) nsMemory::Alloc(sizeof(calIDateTime*));
NS_ADDREF (dates[0] = mDate);
*aDates = dates;
--- a/calendar/base/src/calRecurrenceDateSet.cpp
+++ b/calendar/base/src/calRecurrenceDateSet.cpp
@@ -96,17 +96,17 @@ NS_IMETHODIMP
calRecurrenceDateSet::GetIsFinite(bool *_retval)
{
NS_ENSURE_ARG_POINTER(_retval);
*_retval = true;
return NS_OK;
}
NS_IMETHODIMP
-calRecurrenceDateSet::GetDates(PRUint32 *aCount, calIDateTime ***aDates)
+calRecurrenceDateSet::GetDates(uint32_t *aCount, calIDateTime ***aDates)
{
if (mDates.Count() == 0) {
*aDates = nullptr;
*aCount = 0;
return NS_OK;
}
EnsureSorted();
@@ -121,22 +121,22 @@ calRecurrenceDateSet::GetDates(PRUint32
*aDates = dates;
*aCount = mDates.Count();
return NS_OK;
}
NS_IMETHODIMP
-calRecurrenceDateSet::SetDates(PRUint32 aCount, calIDateTime **aDates)
+calRecurrenceDateSet::SetDates(uint32_t aCount, calIDateTime **aDates)
{
NS_ENSURE_ARG_POINTER(aDates);
mDates.Clear();
- for (PRUint32 i = 0; i < aCount; i++) {
+ for (uint32_t i = 0; i < aCount; i++) {
mDates.AppendObject(aDates[i]);
}
mSorted = false;
return NS_OK;
}
@@ -152,17 +152,17 @@ calRecurrenceDateSet::AddDate(calIDateTi
return NS_OK;
}
static int
calDateTimeComparator (calIDateTime *aElement1,
calIDateTime *aElement2,
void *aData)
{
- PRInt32 result;
+ int32_t result;
aElement1->Compare(aElement2, &result);
return result;
}
void
calRecurrenceDateSet::EnsureSorted()
{
if (!mSorted) {
@@ -177,18 +177,18 @@ calRecurrenceDateSet::GetNextOccurrence(
calIDateTime **_retval)
{
NS_ENSURE_ARG_POINTER(aStartTime);
NS_ENSURE_ARG_POINTER(aOccurrenceTime);
NS_ENSURE_ARG_POINTER(_retval);
EnsureSorted();
- PRInt32 i;
- PRInt32 result;
+ int32_t i;
+ int32_t result;
// we ignore aStartTime
for (i = 0; i < mDates.Count(); i++) {
if (NS_SUCCEEDED(mDates[i]->Compare(aOccurrenceTime, &result)) && result > 0) {
NS_ADDREF (*_retval = mDates[i]);
return NS_OK;
}
}
@@ -196,26 +196,26 @@ calRecurrenceDateSet::GetNextOccurrence(
*_retval = nullptr;
return NS_OK;
}
NS_IMETHODIMP
calRecurrenceDateSet::GetOccurrences(calIDateTime *aStartTime,
calIDateTime *aRangeStart,
calIDateTime *aRangeEnd,
- PRUint32 aMaxCount,
- PRUint32 *aCount, calIDateTime ***aDates)
+ uint32_t aMaxCount,
+ uint32_t *aCount, calIDateTime ***aDates)
{
NS_ENSURE_ARG_POINTER(aStartTime);
NS_ENSURE_ARG_POINTER(aRangeStart);
nsCOMArray<calIDateTime> dates;
- PRInt32 i;
- PRInt32 result;
+ int32_t i;
+ int32_t result;
nsresult rv;
for (i = 0; i < mDates.Count(); i++) {
rv = mDates[i]->Compare(aRangeStart, &result);
NS_ENSURE_SUCCESS(rv, rv);
// if the date is less than aRangeStart, continue
if (result < 0)
@@ -232,17 +232,17 @@ calRecurrenceDateSet::GetOccurrences(cal
// append the date.
dates.AppendObject(mDates[i]);
// if we alrady have as many as we need, break.
if (aMaxCount && dates.Count() == (int) aMaxCount)
break;
}
- PRInt32 count = dates.Count();
+ int32_t count = dates.Count();
if (count) {
calIDateTime **dateArray = (calIDateTime **) nsMemory::Alloc(sizeof(calIDateTime*) * count);
for (int i = 0; i < count; i++) {
NS_ADDREF(dateArray[i] = dates[i]);
}
*aDates = dateArray;
} else {
*aDates = nullptr;
--- a/calendar/base/src/calRecurrenceRule.cpp
+++ b/calendar/base/src/calRecurrenceRule.cpp
@@ -130,17 +130,17 @@ calRecurrenceRule::SetType(const nsACStr
else
return NS_ERROR_FAILURE;
return NS_OK;
}
/* attribute long count; */
NS_IMETHODIMP
-calRecurrenceRule::GetCount(PRInt32 *aRecurCount)
+calRecurrenceRule::GetCount(int32_t *aRecurCount)
{
NS_ENSURE_ARG_POINTER(aRecurCount);
if (!mIsByCount)
return NS_ERROR_FAILURE;
if (mIcalRecur.count == 0 && icaltime_is_null_time(mIcalRecur.until)) {
*aRecurCount = -1;
@@ -150,17 +150,17 @@ calRecurrenceRule::GetCount(PRInt32 *aRe
// count wasn't set, so we don't know
return NS_ERROR_FAILURE;
}
return NS_OK;
}
NS_IMETHODIMP
-calRecurrenceRule::SetCount(PRInt32 aRecurCount)
+calRecurrenceRule::SetCount(int32_t aRecurCount)
{
if (aRecurCount != -1) {
if (aRecurCount < 0 || aRecurCount > INT_MAX)
return NS_ERROR_ILLEGAL_VALUE;
mIcalRecur.count = static_cast<int>(aRecurCount);
} else {
mIcalRecur.count = 0;
}
@@ -225,51 +225,51 @@ NS_IMETHODIMP
calRecurrenceRule::GetIsByCount (bool *aIsByCount)
{
*aIsByCount = mIsByCount;
return NS_OK;
}
/* attribute long interval; */
NS_IMETHODIMP
-calRecurrenceRule::GetInterval(PRInt32 *aInterval)
+calRecurrenceRule::GetInterval(int32_t *aInterval)
{
NS_ENSURE_ARG_POINTER(aInterval);
*aInterval = mIcalRecur.interval;
return NS_OK;
}
NS_IMETHODIMP
-calRecurrenceRule::SetInterval(PRInt32 aInterval)
+calRecurrenceRule::SetInterval(int32_t aInterval)
{
if (aInterval < 0 || aInterval > SHRT_MAX)
return NS_ERROR_ILLEGAL_VALUE;
mIcalRecur.interval = static_cast<short>(aInterval);
return NS_OK;
}
/* void getComponent (in AUTF8String aComponentType, out unsigned long aCount, [array, size_is (aCount), retval] out long aValues); */
NS_IMETHODIMP
-calRecurrenceRule::GetComponent(const nsACString &aComponentType, PRUint32 *aCount, PRInt16 **aValues)
+calRecurrenceRule::GetComponent(const nsACString &aComponentType, uint32_t *aCount, int16_t **aValues)
{
NS_ENSURE_ARG_POINTER(aCount);
NS_ENSURE_ARG_POINTER(aValues);
// This little ugly macro counts the number of real entries
// we have in the relevant array, and then clones it to the result.
#define HANDLE_COMPONENT(_comptype,_icalvar,_icalmax) \
if (aComponentType.EqualsLiteral( #_comptype )) { \
int count; \
for (count = 0; count < _icalmax; count++) { \
if (mIcalRecur._icalvar[count] == ICAL_RECURRENCE_ARRAY_MAX) \
break; \
} \
if (count) { \
- *aValues = (PRInt16*) nsMemory::Clone(mIcalRecur._icalvar, \
- count * sizeof(PRInt16)); \
+ *aValues = (int16_t*) nsMemory::Clone(mIcalRecur._icalvar, \
+ count * sizeof(int16_t)); \
if (!*aValues) return NS_ERROR_OUT_OF_MEMORY; \
} else { \
*aValues = nullptr; \
} \
*aCount = count; \
}
HANDLE_COMPONENT(BYSECOND, by_second, ICAL_BY_SECOND_SIZE)
@@ -287,26 +287,26 @@ calRecurrenceRule::GetComponent(const ns
}
#undef HANDLE_COMPONENT
return NS_OK;
}
/* void setComponent (in AUTF8String aComponentType, in unsigned long aCount, [array, size_is (aCount)] in long aValues); */
NS_IMETHODIMP
-calRecurrenceRule::SetComponent(const nsACString& aComponentType, PRUint32 aCount, PRInt16 *aValues)
+calRecurrenceRule::SetComponent(const nsACString& aComponentType, uint32_t aCount, int16_t *aValues)
{
NS_ENSURE_ARG_POINTER(aValues);
// Copy the passed-in array into the ical structure array
#define HANDLE_COMPONENT(_comptype,_icalvar,_icalmax) \
if (aComponentType.EqualsLiteral( #_comptype )) { \
if (aCount > _icalmax) \
return NS_ERROR_FAILURE; \
- memcpy(mIcalRecur._icalvar, aValues, aCount * sizeof(PRInt16)); \
+ memcpy(mIcalRecur._icalvar, aValues, aCount * sizeof(int16_t)); \
if (aCount < _icalmax) \
mIcalRecur._icalvar[aCount] = ICAL_RECURRENCE_ARRAY_MAX; \
}
HANDLE_COMPONENT(BYSECOND, by_second, ICAL_BY_SECOND_SIZE)
else HANDLE_COMPONENT(BYMINUTE, by_minute, ICAL_BY_MINUTE_SIZE)
else HANDLE_COMPONENT(BYHOUR, by_hour, ICAL_BY_HOUR_SIZE)
else HANDLE_COMPONENT(BYDAY, by_day, ICAL_BY_DAY_SIZE) // special
@@ -380,18 +380,18 @@ static inline icaltimetype ensureDateTim
return ret;
}
}
NS_IMETHODIMP
calRecurrenceRule::GetOccurrences(calIDateTime *aStartTime,
calIDateTime *aRangeStart,
calIDateTime *aRangeEnd,
- PRUint32 aMaxCount,
- PRUint32 *aCount, calIDateTime ***aDates)
+ uint32_t aMaxCount,
+ uint32_t *aCount, calIDateTime ***aDates)
{
NS_ENSURE_ARG_POINTER(aStartTime);
NS_ENSURE_ARG_POINTER(aRangeStart);
NS_ENSURE_ARG_POINTER(aCount);
NS_ENSURE_ARG_POINTER(aDates);
// make sure the request is sane; infinite recurrence
// with no end time is bad times.
@@ -430,17 +430,17 @@ calRecurrenceRule::GetOccurrences(calIDa
}
}
icalrecur_iterator* recur_iter;
recur_iter = icalrecur_iterator_new(mIcalRecur, dtstart);
if (!recur_iter)
return NS_ERROR_OUT_OF_MEMORY;
- PRUint32 count = 0;
+ uint32_t count = 0;
for (icaltimetype next = icalrecur_iterator_next(recur_iter);
!icaltime_is_null_time(next);
next = icalrecur_iterator_next(recur_iter))
{
icaltimetype const dtNext(ensureDateTime(next));
// if this thing is before the range start
@@ -471,17 +471,17 @@ calRecurrenceRule::GetOccurrences(calIDa
}
icalrecur_iterator_free(recur_iter);
if (count) {
calIDateTime ** const dateArray =
static_cast<calIDateTime **>(nsMemory::Alloc(sizeof(calIDateTime*) * count));
CAL_ENSURE_MEMORY(dateArray);
- for (PRUint32 i = 0; i < count; ++i) {
+ for (uint32_t i = 0; i < count; ++i) {
NS_ADDREF(dateArray[i] = dates[i]);
}
*aDates = dateArray;
} else {
*aDates = nullptr;
}
*aCount = count;
--- a/calendar/providers/gdata/public/calIGoogleRequest.idl
+++ b/calendar/providers/gdata/public/calIGoogleRequest.idl
@@ -21,17 +21,17 @@ interface calIGoogleRequest : calIOperat
const unsigned long ADD = 1;
const unsigned long MODIFY = 2;
const unsigned long DELETE = 3;
const unsigned long GET = 4;
/**
* The type of request. Must be one of the above constants.
*/
- attribute PRUint32 type;
+ attribute uint32_t type;
/**
* The request uri string
*/
attribute AUTF8String uri;
/**
* The operation listener. This is not called by the request object, but can
@@ -107,17 +107,17 @@ interface calIGoogleRequest : calIOperat
void commit(in calIGoogleSession aSession);
/**
* Tell listeners that the operation failed
*
* @param aCode The error code to use.
* @param aMessage The error message to use.
*/
- void fail(in PRUint32 aCode, in AUTF8String aMessage);
+ void fail(in uint32_t aCode, in AUTF8String aMessage);
/**
* Tell listeners that the operation succeeded.
*
* @param aMessage The error message to use.
*/
void succeed(in AUTF8String aMessage);
};
--- a/db/mork/public/mdb.h
+++ b/db/mork/public/mdb.h
@@ -42,18 +42,18 @@
#include "nscore.h"
#include "nsISupports.h"
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
// { %%%%% begin scalar typedefs %%%%%
typedef unsigned char mdb_u1; // make sure this is one byte
typedef unsigned short mdb_u2; // make sure this is two bytes
typedef short mdb_i2; // make sure this is two bytes
-typedef PRUint32 mdb_u4; // make sure this is four bytes
-typedef PRInt32 mdb_i4; // make sure this is four bytes
+typedef uint32_t mdb_u4; // make sure this is four bytes
+typedef int32_t mdb_i4; // make sure this is four bytes
typedef PRWord mdb_ip; // make sure sizeof(mdb_ip) == sizeof(void*)
typedef mdb_u1 mdb_bool; // unsigned byte with zero=false, nonzero=true
/* canonical boolean constants provided only for code clarity: */
#define mdbBool_kTrue ((mdb_bool) 1) /* actually any nonzero means true */
#define mdbBool_kFalse ((mdb_bool) 0) /* only zero means false */
--- a/db/mork/src/mork.h
+++ b/db/mork/src/mork.h
@@ -76,18 +76,18 @@
#define mork_OffsetOf(obj,slot) ((unsigned int)&((obj*) 0)->slot)
// } %%%%% end macro for finding class member offset %%%%%
// { %%%%% begin specific-size integer scalar typedefs %%%%%
typedef unsigned char mork_u1; // make sure this is one byte
typedef unsigned short mork_u2; // make sure this is two bytes
typedef short mork_i2; // make sure this is two bytes
-typedef PRUint32 mork_u4; // make sure this is four bytes
-typedef PRInt32 mork_i4; // make sure this is four bytes
+typedef uint32_t mork_u4; // make sure this is four bytes
+typedef int32_t mork_i4; // make sure this is four bytes
typedef PRWord mork_ip; // make sure sizeof(mork_ip) == sizeof(void*)
typedef mork_u1 mork_ch; // small byte-sized character (never wide)
typedef mork_u1 mork_flags; // one byte's worth of predicate bit flags
typedef mork_u2 mork_base; // 2-byte magic class signature slot in object
typedef mork_u2 mork_derived; // 2-byte magic class signature slot in object
typedef mork_u2 mork_uses; // 2-byte strong uses count
--- a/ldap/xpcom/public/nsILDAPOperation.idl
+++ b/ldap/xpcom/public/nsILDAPOperation.idl
@@ -15,17 +15,17 @@ interface nsIMutableArray;
interface nsIArray;
%{C++
#define NS_LDAPOPERATION_CONTRACTID "@mozilla.org/network/ldap-operation;1"
%}
// XXXdmose check to make sure ctl-related err codes documented
-typedef PRUint32 PRIntervalTime;
+typedef uint32_t PRIntervalTime;
[scriptable, uuid(4dfb1b19-fc8f-4525-92e7-f97b78a9747a)]
interface nsILDAPOperation : nsISupports
{
/**
* The connection this operation is on.
*
* @exception NS_ERROR_ILLEGAL_VALUE a NULL pointer was passed in
@@ -246,19 +246,19 @@ interface nsILDAPOperation : nsISupports
* @exception NS_ERROR_OUT_OF_MEMORY ran out of memory
* @exception NS_ERROR_INVALID_ARG invalid argument
* @exception NS_ERROR_LDAP_NOT_SUPPORTED not supported in the version
* of the LDAP protocol that the
* client is using
* @exception NS_ERROR_LDAP_FILTER_ERROR
* @exception NS_ERROR_UNEXPECTED
*/
- void searchExt(in AUTF8String aBaseDn, in PRInt32 aScope,
+ void searchExt(in AUTF8String aBaseDn, in int32_t aScope,
in AUTF8String aFilter, in ACString aAttributes,
- in PRIntervalTime aTimeOut, in PRInt32 aSizeLimit);
+ in PRIntervalTime aTimeOut, in int32_t aSizeLimit);
/**
* Cancels an async operation that is in progress.
*
* XXX controls not supported yet
*
* @exception NS_ERROR_NOT_IMPLEMENTED server or client controls
* were set on this object
--- a/ldap/xpcom/src/nsLDAPBERElement.cpp
+++ b/ldap/xpcom/src/nsLDAPBERElement.cpp
@@ -35,47 +35,47 @@ nsLDAPBERElement::Init(nsILDAPBERValue *
}
mElement = ber_alloc_t(LBER_USE_DER);
return mElement ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
/* void putString (in AUTF8String aString, in unsigned long aTag); */
NS_IMETHODIMP
-nsLDAPBERElement::PutString(const nsACString & aString, PRUint32 aTag,
- PRUint32 *aBytesWritten)
+nsLDAPBERElement::PutString(const nsACString & aString, uint32_t aTag,
+ uint32_t *aBytesWritten)
{
// XXX if the string translation feature of the C SDK is ever used,
// this const_cast will break
int i = ber_put_ostring(mElement,
const_cast<char *>(PromiseFlatCString(aString).get()),
aString.Length(), aTag);
if (i < 0) {
return NS_ERROR_FAILURE;
}
*aBytesWritten = i;
return NS_OK;
}
/* void startSet (); */
-NS_IMETHODIMP nsLDAPBERElement::StartSet(PRUint32 aTag)
+NS_IMETHODIMP nsLDAPBERElement::StartSet(uint32_t aTag)
{
int i = ber_start_set(mElement, aTag);
if (i < 0) {
return NS_ERROR_FAILURE;
}
return NS_OK;
}
/* void putSet (); */
-NS_IMETHODIMP nsLDAPBERElement::PutSet(PRUint32 *aBytesWritten)
+NS_IMETHODIMP nsLDAPBERElement::PutSet(uint32_t *aBytesWritten)
{
int i = ber_put_set(mElement);
if (i < 0) {
return NS_ERROR_FAILURE;
}
*aBytesWritten = i;
@@ -95,17 +95,17 @@ NS_IMETHODIMP nsLDAPBERElement::GetAsVal
}
struct berval *bv;
if ( ber_flatten(mElement, &bv) < 0 ) {
return NS_ERROR_OUT_OF_MEMORY;
}
nsresult rv = berValue->Set(bv->bv_len,
- reinterpret_cast<PRUint8 *>(bv->bv_val));
+ reinterpret_cast<uint8_t *>(bv->bv_val));
// whether or not we've succeeded, we're done with the ldap c sdk struct
ber_bvfree(bv);
// as of this writing, this error can only be NS_ERROR_OUT_OF_MEMORY
if (NS_FAILED(rv)) {
return rv;
}
--- a/ldap/xpcom/src/nsLDAPBERValue.cpp
+++ b/ldap/xpcom/src/nsLDAPBERValue.cpp
@@ -19,24 +19,24 @@ nsLDAPBERValue::~nsLDAPBERValue()
if (mValue) {
nsMemory::Free(mValue);
}
}
// void get (out unsigned long aCount,
// [array, size_is (aCount), retval] out octet aRetVal); */
NS_IMETHODIMP
-nsLDAPBERValue::Get(PRUint32 *aCount, PRUint8 **aRetVal)
+nsLDAPBERValue::Get(uint32_t *aCount, uint8_t **aRetVal)
{
// if mSize = 0, return a count of a 0 and a null pointer
if (mSize) {
// get a buffer to hold a copy of the data
//
- PRUint8 *array = static_cast<PRUint8 *>(nsMemory::Alloc(mSize));
+ uint8_t *array = static_cast<uint8_t *>(nsMemory::Alloc(mSize));
if (!array) {
return NS_ERROR_OUT_OF_MEMORY;
}
// copy and return
//
memcpy(array, mValue, mSize);
@@ -47,30 +47,30 @@ nsLDAPBERValue::Get(PRUint32 *aCount, PR
*aCount = mSize;
return NS_OK;
}
// void set(in unsigned long aCount,
// [array, size_is(aCount)] in octet aValue);
NS_IMETHODIMP
-nsLDAPBERValue::Set(PRUint32 aCount, PRUint8 *aValue)
+nsLDAPBERValue::Set(uint32_t aCount, uint8_t *aValue)
{
// get rid of any old value being held here
//
if (mValue) {
nsMemory::Free(mValue);
}
// if this is a non-zero value, allocate a buffer and copy
//
if (aCount) {
// get a buffer to hold a copy of this data
//
- mValue = static_cast<PRUint8 *>(nsMemory::Alloc(aCount));
+ mValue = static_cast<uint8_t *>(nsMemory::Alloc(aCount));
if (!mValue) {
return NS_ERROR_OUT_OF_MEMORY;
}
// copy the data and return
//
memcpy(mValue, aValue, aCount);
} else {
@@ -93,14 +93,14 @@ nsLDAPBERValue::SetFromUTF8(const nsACSt
if (mValue) {
nsMemory::Free(mValue);
}
// copy the data and return
//
mSize = aValue.Length();
if (mSize) {
- mValue = reinterpret_cast<PRUint8 *>(ToNewCString(aValue));
+ mValue = reinterpret_cast<uint8_t *>(ToNewCString(aValue));
} else {
mValue = 0;
}
return NS_OK;
}
--- a/ldap/xpcom/src/nsLDAPBERValue.h
+++ b/ldap/xpcom/src/nsLDAPBERValue.h
@@ -28,13 +28,13 @@ public:
protected:
/**
* nsLDAPControl needs to be able to grovel through this without an
* an extra copy
*/
friend class nsLDAPControl;
- PRUint8 *mValue; // pointer to an array
- PRUint32 mSize; // size of the value, in bytes
+ uint8_t *mValue; // pointer to an array
+ uint32_t mSize; // size of the value, in bytes
};
#endif // _nsLDAPBERValue_h_
--- a/ldap/xpcom/src/nsLDAPConnection.cpp
+++ b/ldap/xpcom/src/nsLDAPConnection.cpp
@@ -64,17 +64,17 @@ NS_INTERFACE_MAP_BEGIN(nsLDAPConnection)
NS_INTERFACE_MAP_END_THREADSAFE
NS_IMPL_CI_INTERFACE_GETTER4(nsLDAPConnection, nsILDAPConnection,
nsISupportsWeakReference, nsIDNSListener,
nsIObserver)
NS_IMETHODIMP
nsLDAPConnection::Init(nsILDAPURL *aUrl, const nsACString &aBindName,
nsILDAPMessageListener *aMessageListener,
- nsISupports *aClosure, PRUint32 aVersion)
+ nsISupports *aClosure, uint32_t aVersion)
{
NS_ENSURE_ARG_POINTER(aUrl);
NS_ENSURE_ARG_POINTER(aMessageListener);
nsresult rv;
nsCOMPtr<nsIObserverService> obsServ =
do_GetService(NS_OBSERVERSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
@@ -99,17 +99,17 @@ nsLDAPConnection::Init(nsILDAPURL *aUrl,
}
mVersion = aVersion;
// Get the port number, SSL flag for use later, once the DNS server(s)
// has resolved the host part.
rv = aUrl->GetPort(&mPort);
NS_ENSURE_SUCCESS(rv, rv);
- PRUint32 options;
+ uint32_t options;
rv = aUrl->GetOptions(&options);
NS_ENSURE_SUCCESS(rv, rv);
mSSL = options & nsILDAPURL::OPT_SECURE;
// Initialise the hashtable to keep track of pending operations.
// 10 buckets seems like a reasonable size.
mPendingOperations.Init(10);
@@ -139,17 +139,17 @@ nsLDAPConnection::Init(nsILDAPURL *aUrl,
NS_ENSURE_SUCCESS(rv, rv);
// if the caller has passed in a space-delimited set of hosts, as the
// ldap c-sdk allows, strip off the trailing hosts for now.
// Soon, we'd like to make multiple hosts work, but now make
// at least the first one work.
LdapCompressWhitespace(mDNSHost);
- PRInt32 spacePos = mDNSHost.FindChar(' ');
+ int32_t spacePos = mDNSHost.FindChar(' ');
// trim off trailing host(s)
if (spacePos != kNotFound)
mDNSHost.SetLength(spacePos);
rv = pDNSService->AsyncResolve(mDNSHost, 0, this, curThread,
getter_AddRefs(mDNSRequest));
if (NS_FAILED(rv)) {
@@ -206,17 +206,17 @@ nsLDAPConnection::Close()
}
mInitListener = 0;
}
/** Get list of pending operation and store pointers to array
* \param userArg pointer to nsTArray<nsILDAPOperation*>
*/
PLDHashOperator
-GetListOfPendingOperations(const PRUint32 &key, nsILDAPOperation *op, void *userArg)
+GetListOfPendingOperations(const uint32_t &key, nsILDAPOperation *op, void *userArg)
{
nsTArray<nsILDAPOperation*>* pending_operations = static_cast<nsTArray<nsILDAPOperation*>* >(userArg);
pending_operations->AppendElement(op);
return PL_DHASH_NEXT;
}
NS_IMETHODIMP
nsLDAPConnection::Observe(nsISupports *aSubject, const char *aTopic,
@@ -227,17 +227,17 @@ nsLDAPConnection::Observe(nsISupports *a
if (mPendingOperations.Count() > 0) {
/* We cannot use enumerate function to abort operations because
* nsILDAPOperation::AbandonExt() is modifying list of operations
* and this leads to starvation.
* We have to do a copy of pending operations.
*/
nsTArray<nsILDAPOperation*> pending_operations;
mPendingOperations.EnumerateRead(GetListOfPendingOperations, (void *) (&pending_operations));
- for (PRUint32 i = 0; i < pending_operations.Length(); i++) {
+ for (uint32_t i = 0; i < pending_operations.Length(); i++) {
pending_operations[i]->AbandonExt();
}
}
Close();
} else {
NS_NOTREACHED("unexpected topic");
return NS_ERROR_UNEXPECTED;
}
@@ -272,17 +272,17 @@ nsLDAPConnection::GetBindName(nsACString
return NS_OK;
}
// wrapper for ldap_get_lderrno
// XXX should copy before returning
//
NS_IMETHODIMP
nsLDAPConnection::GetLdErrno(nsACString& matched, nsACString& errString,
- PRInt32 *_retval)
+ int32_t *_retval)
{
char *match, *err;
NS_ENSURE_ARG_POINTER(_retval);
*_retval = ldap_get_lderrno(mConnectionHandle, &match, &err);
matched.Assign(match);
errString.Assign(err);
@@ -316,23 +316,23 @@ nsLDAPConnection::GetErrorString(PRUnich
}
/**
* Add an nsILDAPOperation to the list of operations pending on
* this connection. This is also mainly intended for use by the
* nsLDAPOperation code.
*/
nsresult
-nsLDAPConnection::AddPendingOperation(PRUint32 aOperationID, nsILDAPOperation *aOperation)
+nsLDAPConnection::AddPendingOperation(uint32_t aOperationID, nsILDAPOperation *aOperation)
{
NS_ENSURE_ARG_POINTER(aOperation);
nsIRunnable* runnable = new nsLDAPConnectionRunnable(aOperationID, aOperation,
this);
- mPendingOperations.Put((PRUint32)aOperationID, aOperation);
+ mPendingOperations.Put((uint32_t)aOperationID, aOperation);
nsresult rv;
if (!mThread)
{
rv = NS_NewThread(getter_AddRefs(mThread), runnable);
NS_ENSURE_SUCCESS(rv, rv);
}
else
@@ -355,17 +355,17 @@ nsLDAPConnection::AddPendingOperation(PR
* @param aOperation operation to add
* @exception NS_ERROR_INVALID_POINTER aOperation was NULL
* @exception NS_ERROR_OUT_OF_MEMORY out of memory
* @exception NS_ERROR_FAILURE could not delete the operation
*
* void removePendingOperation(in nsILDAPOperation aOperation);
*/
nsresult
-nsLDAPConnection::RemovePendingOperation(PRUint32 aOperationID)
+nsLDAPConnection::RemovePendingOperation(uint32_t aOperationID)
{
NS_ENSURE_TRUE(aOperationID > 0, NS_ERROR_UNEXPECTED);
PR_LOG(gLDAPLogModule, PR_LOG_DEBUG,
("nsLDAPConnection::RemovePendingOperation(): operation removed\n"));
mPendingOperations.Remove(aOperationID);
PR_LOG(gLDAPLogModule, PR_LOG_DEBUG,
@@ -421,28 +421,28 @@ nsOnLDAPInitMessageRunnable::nsOnLDAPIni
NS_IMETHODIMP nsOnLDAPInitMessageRunnable::Run()
{
return m_listener->OnLDAPInit(m_conn, m_status);
}
nsresult
nsLDAPConnection::InvokeMessageCallback(LDAPMessage *aMsgHandle,
nsILDAPMessage *aMsg,
- PRInt32 aOperation,
+ int32_t aOperation,
bool aRemoveOpFromConnQ)
{
#if defined(DEBUG)
// We only want this being logged for debug builds so as not to affect performance too much.
PR_LOG(gLDAPLogModule, PR_LOG_DEBUG, ("InvokeMessageCallback entered\n"));
#endif
nsresult rv;
// Get the operation.
nsCOMPtr<nsILDAPOperation> operation;
- mPendingOperations.Get((PRUint32)aOperation, getter_AddRefs(operation));
+ mPendingOperations.Get((uint32_t)aOperation, getter_AddRefs(operation));
NS_ENSURE_TRUE(operation, NS_ERROR_NULL_POINTER);
static_cast<nsLDAPMessage *>(aMsg)->mOperation = operation;
// get the message listener object.
nsCOMPtr<nsILDAPMessageListener> listener;
rv = operation->GetMessageListener(getter_AddRefs(listener));
@@ -486,17 +486,17 @@ nsLDAPConnection::OnLookupComplete(nsICa
{
nsresult rv = NS_OK;
if (aRecord) {
// Build mResolvedIP list
//
mResolvedIP.Truncate();
- PRInt32 index = 0;
+ int32_t index = 0;
char addrbuf[64];
PRNetAddr addr;
while (NS_SUCCEEDED(aRecord->GetNextAddr(0, &addr))) {
// We can only use v4 addresses
//
bool v4mapped = false;
if (addr.raw.family == PR_AF_INET6)
@@ -618,17 +618,17 @@ nsLDAPConnection::OnLookupComplete(nsICa
// Call the listener, and then we can release our reference to it.
//
mInitListener->OnLDAPInit(this, rv);
mInitListener = 0;
return rv;
}
-nsLDAPConnectionRunnable::nsLDAPConnectionRunnable(PRInt32 aOperationID,
+nsLDAPConnectionRunnable::nsLDAPConnectionRunnable(int32_t aOperationID,
nsILDAPOperation *aOperation,
nsLDAPConnection *aConnection)
: mOperationID(aOperationID), mConnection(aConnection)
{
}
nsLDAPConnectionRunnable::~nsLDAPConnectionRunnable()
{
@@ -645,17 +645,17 @@ NS_IMETHODIMP nsLDAPConnectionRunnable::
LDAPMessage *msgHandle;
bool operationFinished = true;
nsRefPtr<nsLDAPMessage> msg;
struct timeval timeout = { 0, 0 };
nsCOMPtr<nsIThread> thread = do_GetCurrentThread();
- PRInt32 returnCode = ldap_result(mConnection->mConnectionHandle, mOperationID, LDAP_MSG_ONE, &timeout, &msgHandle);
+ int32_t returnCode = ldap_result(mConnection->mConnectionHandle, mOperationID, LDAP_MSG_ONE, &timeout, &msgHandle);
switch (returnCode)
{
// timeout
case 0:
// XXX do we need a timer?
return thread->Dispatch(this, nsIEventTarget::DISPATCH_NORMAL);
case -1:
NS_ERROR("We don't know what went wrong with the ldap operation");
@@ -674,17 +674,17 @@ NS_IMETHODIMP nsLDAPConnectionRunnable::
// initialize the message, using a protected method not available
// through nsILDAPMessage (which is why we need the raw pointer)
nsresult rv = msg->Init(mConnection, msgHandle);
switch (rv)
{
case NS_OK:
{
- PRInt32 errorCode;
+ int32_t errorCode;
msg->GetErrorCode(&errorCode);
// maybe a version error, e.g., using v3 on a v2 server.
// if we're using v3, try v2.
if (errorCode == LDAP_PROTOCOL_ERROR &&
mConnection->mVersion == nsILDAPConnection::VERSION3)
{
nsCAutoString password;
@@ -707,17 +707,17 @@ NS_IMETHODIMP nsLDAPConnectionRunnable::
//
if (errorCode == LDAP_SASL_BIND_IN_PROGRESS) {
struct berval *creds;
ldap_parse_sasl_bind_result(
mConnection->mConnectionHandle, msgHandle,
&creds, 0);
nsCOMPtr<nsILDAPOperation> operation;
- mConnection->mPendingOperations.Get((PRUint32)mOperationID, getter_AddRefs(operation));
+ mConnection->mPendingOperations.Get((uint32_t)mOperationID, getter_AddRefs(operation));
NS_ENSURE_TRUE(operation, NS_ERROR_NULL_POINTER);
nsresult rv = operation->SaslStep(creds->bv_val, creds->bv_len);
if (NS_SUCCEEDED(rv))
return NS_OK;
}
break;
--- a/ldap/xpcom/src/nsLDAPConnection.h
+++ b/ldap/xpcom/src/nsLDAPConnection.h
@@ -53,72 +53,72 @@ class nsLDAPConnection : public nsILDAPC
virtual ~nsLDAPConnection();
protected:
// invoke the callback associated with a given message, and possibly
// delete it from the connection queue
//
nsresult InvokeMessageCallback(LDAPMessage *aMsgHandle,
nsILDAPMessage *aMsg,
- PRInt32 aOperation,
+ int32_t aOperation,
bool aRemoveOpFromConnQ);
/**
* Add an nsILDAPOperation to the list of operations pending on
* this connection. This is mainly intended for use by the
* nsLDAPOperation code. Used so that the thread waiting on messages
* for this connection has an operation to callback to.
*
* @param aOperation operation to add
* @exception NS_ERROR_ILLEGAL_VALUE aOperation was NULL
* @exception NS_ERROR_UNEXPECTED this operation's msgId was not
* unique to this connection
* @exception NS_ERROR_OUT_OF_MEMORY out of memory
*/
- nsresult AddPendingOperation(PRUint32 aOperationID, nsILDAPOperation *aOperation);
+ nsresult AddPendingOperation(uint32_t aOperationID, nsILDAPOperation *aOperation);
/**
* Remove an nsILDAPOperation from the list of operations pending on this
* connection. Mainly intended for use by the nsLDAPOperation code.
*
* @param aOperation operation to add
* @exception NS_ERROR_INVALID_POINTER aOperation was NULL
* @exception NS_ERROR_OUT_OF_MEMORY out of memory
* @exception NS_ERROR_FAILURE could not delete the operation
*/
- nsresult RemovePendingOperation(PRUint32 aOperationID);
+ nsresult RemovePendingOperation(uint32_t aOperationID);
void Close(); // close the connection
LDAP *mConnectionHandle; // the LDAP C SDK's connection object
nsCString mBindName; // who to bind as
nsCOMPtr<nsIThread> mThread; // thread which marshals results
nsInterfaceHashtableMT<nsUint32HashKey, nsILDAPOperation> mPendingOperations;
- PRInt32 mPort; // The LDAP port we're binding to
+ int32_t mPort; // The LDAP port we're binding to
bool mSSL; // the options
- PRUint32 mVersion; // LDAP protocol version
+ uint32_t mVersion; // LDAP protocol version
nsCString mResolvedIP; // Preresolved list of host IPs
nsCOMPtr<nsILDAPMessageListener> mInitListener; // Init callback
nsCOMPtr<nsICancelable> mDNSRequest; // The "active" DNS request
nsCString mDNSHost; // The hostname being resolved
nsCOMPtr<nsISupports> mClosure; // private parameter (anything caller desires)
};
class nsLDAPConnectionRunnable : public nsIRunnable
{
friend class nsLDAPConnection;
friend class nsLDAPMessage;
public:
- nsLDAPConnectionRunnable(PRInt32 aOperationID,
+ nsLDAPConnectionRunnable(int32_t aOperationID,
nsILDAPOperation *aOperation,
nsLDAPConnection *aConnection);
virtual ~nsLDAPConnectionRunnable();
NS_DECL_ISUPPORTS
NS_DECL_NSIRUNNABLE
- PRInt32 mOperationID;
+ int32_t mOperationID;
nsRefPtr<nsLDAPConnection> mConnection;
};
#endif // _nsLDAPConnection_h_
--- a/ldap/xpcom/src/nsLDAPMessage.cpp
+++ b/ldap/xpcom/src/nsLDAPMessage.cpp
@@ -204,28 +204,28 @@ nsLDAPMessage::Init(nsILDAPConnection *a
/**
* The result code of the (possibly partial) operation.
*
* @exception NS_ERROR_ILLEGAL_VALUE null pointer passed in
*
* readonly attribute long errorCode;
*/
NS_IMETHODIMP
-nsLDAPMessage::GetErrorCode(PRInt32 *aErrorCode)
+nsLDAPMessage::GetErrorCode(int32_t *aErrorCode)
{
if (!aErrorCode) {
return NS_ERROR_ILLEGAL_VALUE;
}
*aErrorCode = mErrorCode;
return NS_OK;
}
NS_IMETHODIMP
-nsLDAPMessage::GetType(PRInt32 *aType)
+nsLDAPMessage::GetType(int32_t *aType)
{
if (!aType) {
return NS_ERROR_ILLEGAL_VALUE;
}
*aType = ldap_msgtype(mMsgHandle);
if (*aType == -1) {
return NS_ERROR_UNEXPECTED;
@@ -233,17 +233,17 @@ nsLDAPMessage::GetType(PRInt32 *aType)
return NS_OK;
}
// we don't get to use exceptions, so we'll fake it. this is an error
// handler for IterateAttributes().
//
nsresult
-nsLDAPMessage::IterateAttrErrHandler(PRInt32 aLderrno, PRUint32 *aAttrCount,
+nsLDAPMessage::IterateAttrErrHandler(int32_t aLderrno, uint32_t *aAttrCount,
char** *aAttributes, BerElement *position)
{
// if necessary, free the position holder used by
// ldap_{first,next}_attribute()
//
if (position) {
ldap_ber_free(position, 0);
@@ -282,29 +282,29 @@ nsLDAPMessage::IterateAttrErrHandler(PRI
"unexpected value; possible bug or memory corruption");
return NS_ERROR_UNEXPECTED;
}
// wrapper for ldap_first_attribute
//
NS_IMETHODIMP
-nsLDAPMessage::GetAttributes(PRUint32 *aAttrCount, char** *aAttributes)
+nsLDAPMessage::GetAttributes(uint32_t *aAttrCount, char** *aAttributes)
{
return IterateAttributes(aAttrCount, aAttributes, true);
}
// if getP is true, we get the attributes by recursing once
// (without getP set) in order to fill in *attrCount, then allocate
// and fill in the *aAttributes.
//
// if getP is false, just fill in *attrCount and return
//
nsresult
-nsLDAPMessage::IterateAttributes(PRUint32 *aAttrCount, char** *aAttributes,
+nsLDAPMessage::IterateAttributes(uint32_t *aAttrCount, char** *aAttributes,
bool getP)
{
BerElement *position;
nsresult rv;
if (!aAttrCount || !aAttributes ) {
return NS_ERROR_INVALID_POINTER;
}
@@ -369,17 +369,17 @@ nsLDAPMessage::IterateAttributes(PRUint3
attr = ldap_next_attribute(mConnectionHandle, mMsgHandle, position);
// check to see if there is an error, or if we're just done iterating
//
if (!attr) {
// bail out if there's an error
//
- PRInt32 lderrno = ldap_get_lderrno(mConnectionHandle, 0, 0);
+ int32_t lderrno = ldap_get_lderrno(mConnectionHandle, 0, 0);
if (lderrno != LDAP_SUCCESS) {
return IterateAttrErrHandler(lderrno, aAttrCount, aAttributes,
position);
}
// otherwise, there are no more attributes; we're done with
// the while loop
//
@@ -416,17 +416,17 @@ nsLDAPMessage::IterateAttributes(PRUint3
}
// readonly attribute wstring dn;
NS_IMETHODIMP nsLDAPMessage::GetDn(nsACString& aDn)
{
char *rawDn = ldap_get_dn(mConnectionHandle, mMsgHandle);
if (!rawDn) {
- PRInt32 lderrno = ldap_get_lderrno(mConnectionHandle, 0, 0);
+ int32_t lderrno = ldap_get_lderrno(mConnectionHandle, 0, 0);
switch (lderrno) {
case LDAP_DECODING_ERROR:
NS_WARNING("nsLDAPMessage::GetDn(): ldap decoding error");
return NS_ERROR_LDAP_DECODING_ERROR;
case LDAP_PARAM_ERROR:
@@ -443,33 +443,33 @@ NS_IMETHODIMP nsLDAPMessage::GetDn(nsACS
ldap_memfree(rawDn);
return NS_OK;
}
// wrapper for ldap_get_values()
//
NS_IMETHODIMP
-nsLDAPMessage::GetValues(const char *aAttr, PRUint32 *aCount,
+nsLDAPMessage::GetValues(const char *aAttr, uint32_t *aCount,
PRUnichar ***aValues)
{
char **values;
#if defined(DEBUG)
// We only want this being logged for debug builds so as not to affect performance too much.
PR_LOG(gLDAPLogModule, PR_LOG_DEBUG,
("nsLDAPMessage::GetValues(): called with aAttr = '%s'", aAttr));
#endif
values = ldap_get_values(mConnectionHandle, mMsgHandle, aAttr);
// bail out if there was a problem
//
if (!values) {
- PRInt32 lderrno = ldap_get_lderrno(mConnectionHandle, 0, 0);
+ int32_t lderrno = ldap_get_lderrno(mConnectionHandle, 0, 0);
if ( lderrno == LDAP_DECODING_ERROR ) {
// this may not be an error; it could just be that the
// caller has asked for an attribute that doesn't exist.
//
PR_LOG(gLDAPLogModule, PR_LOG_WARNING,
("nsLDAPMessage::GetValues(): ldap_get_values returned "
"LDAP_DECODING_ERROR"));
@@ -482,30 +482,30 @@ nsLDAPMessage::GetValues(const char *aAt
} else {
NS_ERROR("nsLDAPMessage::GetValues(): internal error: 2");
return NS_ERROR_UNEXPECTED;
}
}
// count the values
//
- PRUint32 numVals = ldap_count_values(values);
+ uint32_t numVals = ldap_count_values(values);
// create an array of the appropriate size
//
*aValues = static_cast<PRUnichar **>(nsMemory::Alloc(numVals * sizeof(PRUnichar *)));
if (!*aValues) {
ldap_value_free(values);
return NS_ERROR_OUT_OF_MEMORY;
}
// clone the array (except for the trailing NULL entry) using the
// shared allocator for XPCOM correctness
//
- PRUint32 i;
+ uint32_t i;
for ( i = 0 ; i < numVals ; i++ ) {
nsDependentCString sValue(values[i]);
if (IsUTF8(sValue))
(*aValues)[i] = ToNewUnicode(NS_ConvertUTF8toUTF16(sValue));
else
(*aValues)[i] = ToNewUnicode(NS_ConvertASCIItoUTF16(sValue));
if ( ! (*aValues)[i] ) {
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(i, aValues);
@@ -520,34 +520,34 @@ nsLDAPMessage::GetValues(const char *aAt
*aCount = numVals;
return NS_OK;
}
// wrapper for get_values_len
//
NS_IMETHODIMP
-nsLDAPMessage::GetBinaryValues(const char *aAttr, PRUint32 *aCount,
+nsLDAPMessage::GetBinaryValues(const char *aAttr, uint32_t *aCount,
nsILDAPBERValue ***aValues)
{
struct berval **values;
#if defined(DEBUG)
// We only want this being logged for debug builds so as not to affect performance too much.
PR_LOG(gLDAPLogModule, PR_LOG_DEBUG,
("nsLDAPMessage::GetBinaryValues(): called with aAttr = '%s'",
aAttr));
#endif
values = ldap_get_values_len(mConnectionHandle, mMsgHandle, aAttr);
// bail out if there was a problem
//
if (!values) {
- PRInt32 lderrno = ldap_get_lderrno(mConnectionHandle, 0, 0);
+ int32_t lderrno = ldap_get_lderrno(mConnectionHandle, 0, 0);
if ( lderrno == LDAP_DECODING_ERROR ) {
// this may not be an error; it could just be that the
// caller has asked for an attribute that doesn't exist.
//
PR_LOG(gLDAPLogModule, PR_LOG_WARNING,
("nsLDAPMessage::GetBinaryValues(): ldap_get_values "
"returned LDAP_DECODING_ERROR"));
@@ -560,31 +560,31 @@ nsLDAPMessage::GetBinaryValues(const cha
} else {
NS_ERROR("nsLDAPMessage::GetBinaryValues(): internal error: 2");
return NS_ERROR_UNEXPECTED;
}
}
// count the values
//
- PRUint32 numVals = ldap_count_values_len(values);
+ uint32_t numVals = ldap_count_values_len(values);
// create the out array
//
*aValues =
static_cast<nsILDAPBERValue **>(nsMemory::Alloc(numVals * sizeof(nsILDAPBERValue)));
if (!aValues) {
ldap_value_free_len(values);
return NS_ERROR_OUT_OF_MEMORY;
}
// clone the array (except for the trailing NULL entry) using the
// shared allocator for XPCOM correctness
//
- PRUint32 i;
+ uint32_t i;
nsresult rv;
for ( i = 0 ; i < numVals ; i++ ) {
// create an nsBERValue object
//
nsCOMPtr<nsILDAPBERValue> berValue = new nsLDAPBERValue();
if (!berValue) {
NS_ERROR("nsLDAPMessage::GetBinaryValues(): out of memory"
@@ -592,17 +592,17 @@ nsLDAPMessage::GetBinaryValues(const cha
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(i, aValues);
ldap_value_free_len(values);
return NS_ERROR_OUT_OF_MEMORY;
}
// copy the value from the struct into the nsBERValue
//
rv = berValue->Set(values[i]->bv_len,
- reinterpret_cast<PRUint8 *>(values[i]->bv_val));
+ reinterpret_cast<uint8_t *>(values[i]->bv_val));
if (NS_FAILED(rv)) {
NS_ERROR("nsLDAPMessage::GetBinaryValues(): error setting"
" nsBERValue");
ldap_value_free_len(values);
return rv == NS_ERROR_OUT_OF_MEMORY ? rv : NS_ERROR_UNEXPECTED;
}
// put the nsIBERValue object into the out array
--- a/ldap/xpcom/src/nsLDAPMessage.h
+++ b/ldap/xpcom/src/nsLDAPMessage.h
@@ -30,19 +30,19 @@ class nsLDAPMessage : public nsILDAPMess
NS_DECL_NSILDAPMESSAGE
// constructor & destructor
//
nsLDAPMessage();
virtual ~nsLDAPMessage();
protected:
- nsresult IterateAttrErrHandler(PRInt32 aLderrno, PRUint32 *aAttrCount,
+ nsresult IterateAttrErrHandler(int32_t aLderrno, uint32_t *aAttrCount,
char** *aAttributes, BerElement *position);
- nsresult IterateAttributes(PRUint32 *aAttrCount, char** *aAttributes,
+ nsresult IterateAttributes(uint32_t *aAttrCount, char** *aAttributes,
bool getP);
nsresult Init(nsILDAPConnection *aConnection,
LDAPMessage *aMsgHandle);
LDAPMessage *mMsgHandle; // the message we're wrapping
nsCOMPtr<nsILDAPOperation> mOperation; // operation this msg relates to
LDAP *mConnectionHandle; // cached connection this op is on
--- a/ldap/xpcom/src/nsLDAPModification.cpp
+++ b/ldap/xpcom/src/nsLDAPModification.cpp
@@ -28,25 +28,25 @@ nsLDAPModification::~nsLDAPModification(
nsresult
nsLDAPModification::Init()
{
return NS_OK;
}
NS_IMETHODIMP
-nsLDAPModification::GetOperation(PRInt32 *aOperation)
+nsLDAPModification::GetOperation(int32_t *aOperation)
{
NS_ENSURE_ARG_POINTER(aOperation);
*aOperation = mOperation;
return NS_OK;
}
-NS_IMETHODIMP nsLDAPModification::SetOperation(PRInt32 aOperation)
+NS_IMETHODIMP nsLDAPModification::SetOperation(int32_t aOperation)
{
mOperation = aOperation;
return NS_OK;
}
NS_IMETHODIMP
nsLDAPModification::GetType(nsACString& aType)
{
@@ -112,34 +112,34 @@ nsLDAPModification::SetValues(nsIArray*
rv = enumerator->HasMoreElements(&hasMoreElements);
NS_ENSURE_SUCCESS(rv, rv);
}
return NS_OK;
}
NS_IMETHODIMP
-nsLDAPModification::SetUpModification(PRInt32 aOperation,
+nsLDAPModification::SetUpModification(int32_t aOperation,
const nsACString &aType,
nsIArray *aValues)
{
// Set the values using our local function before entering lock
// to avoid deadlocks due to holding the same lock twice.
nsresult rv = SetValues(aValues);
MutexAutoLock lock(mValuesLock);
mOperation = aOperation;
mType.Assign(aType);
return rv;
}
NS_IMETHODIMP
-nsLDAPModification::SetUpModificationOneValue(PRInt32 aOperation,
+nsLDAPModification::SetUpModificationOneValue(int32_t aOperation,
const nsACString &aType,
nsILDAPBERValue *aValue)
{
NS_ENSURE_ARG_POINTER(aValue);
MutexAutoLock lock(mValuesLock);
mOperation = aOperation;
--- a/ldap/xpcom/src/nsLDAPModification.h
+++ b/ldap/xpcom/src/nsLDAPModification.h
@@ -27,15 +27,15 @@ public:
// constructor & destructor
//
nsLDAPModification();
virtual ~nsLDAPModification();
nsresult Init();
private:
- PRInt32 mOperation;
+ int32_t mOperation;
nsCString mType;
nsCOMPtr<nsIMutableArray> mValues;
mozilla::Mutex mValuesLock;
};
#endif // _nsLDAPModification_h_
--- a/ldap/xpcom/src/nsLDAPOperation.cpp
+++ b/ldap/xpcom/src/nsLDAPOperation.cpp
@@ -204,17 +204,17 @@ nsLDAPOperation::SaslBind(const nsACStri
if (NS_FAILED(rv))
(void)ldap_abandon_ext(mConnectionHandle, mMsgID, 0, 0);
return rv;
}
NS_IMETHODIMP
-nsLDAPOperation::SaslStep(const char *token, PRUint32 tokenLen)
+nsLDAPOperation::SaslStep(const char *token, uint32_t tokenLen)
{
nsresult rv;
nsCAutoString bindName;
struct berval clientCreds;
struct berval serverCreds;
unsigned int credlen;
rv = mConnection->RemovePendingOperation(mMsgID);
@@ -257,17 +257,17 @@ NS_IMETHODIMP
nsLDAPOperation::SimpleBind(const nsACString& passwd)
{
nsRefPtr<nsLDAPConnection> connection = mConnection;
// There is a possibilty that mConnection can be cleared by another
// thread. Grabbing a local reference to mConnection may avoid this.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=557928#c1
nsresult rv;
nsCAutoString bindName;
- PRInt32 originalMsgID = mMsgID;
+ int32_t originalMsgID = mMsgID;
// Ugly hack alert:
// the first time we get called with a passwd, remember it.
// Then, if we get called again w/o a password, use the
// saved one. Getting called again means we're trying to
// fall back to VERSION2.
// Since LDAP operations are thrown away when done, it won't stay
// around in memory.
if (!passwd.IsEmpty())
@@ -325,17 +325,17 @@ nsLDAPOperation::SimpleBind(const nsACSt
/**
* Given an nsIArray of nsILDAPControls, return the appropriate
* zero-terminated array of LDAPControls ready to pass in to the C SDK.
*/
static nsresult
convertControlArray(nsIArray *aXpcomArray, LDAPControl ***aArray)
{
// get the size of the original array
- PRUint32 length;
+ uint32_t length;
nsresult rv = aXpcomArray->GetLength(&length);
NS_ENSURE_SUCCESS(rv, rv);
// don't allocate an array if someone passed us in an empty one
if (!length) {
*aArray = 0;
return NS_OK;
}
@@ -352,17 +352,17 @@ convertControlArray(nsIArray *aXpcomArra
nsCOMPtr<nsISimpleEnumerator> enumerator;
rv = aXpcomArray->Enumerate(getter_AddRefs(enumerator));
NS_ENSURE_SUCCESS(rv, rv);
bool moreElements;
rv = enumerator->HasMoreElements(&moreElements);
NS_ENSURE_SUCCESS(rv, rv);
- PRUint32 i = 0;
+ uint32_t i = 0;
while (moreElements) {
// get the next array element
nsCOMPtr<nsISupports> isupports;
rv = enumerator->GetNext(getter_AddRefs(isupports));
if (NS_FAILED(rv)) {
ldap_controls_free(controls);
return rv;
@@ -392,20 +392,20 @@ convertControlArray(nsIArray *aXpcomArra
++i;
}
*aArray = controls;
return NS_OK;
}
NS_IMETHODIMP
-nsLDAPOperation::SearchExt(const nsACString& aBaseDn, PRInt32 aScope,
+nsLDAPOperation::SearchExt(const nsACString& aBaseDn, int32_t aScope,
const nsACString& aFilter,
const nsACString &aAttributes,
- PRIntervalTime aTimeOut, PRInt32 aSizeLimit)
+ PRIntervalTime aTimeOut, int32_t aSizeLimit)
{
if (!mMessageListener) {
NS_ERROR("nsLDAPOperation::SearchExt(): mMessageListener not set");
return NS_ERROR_NOT_INITIALIZED;
}
// XXX add control logging
PR_LOG(gLDAPLogModule, PR_LOG_DEBUG,
@@ -439,24 +439,24 @@ nsLDAPOperation::SearchExt(const nsACStr
}
}
// Convert our comma separated string to one that the C-SDK will like, i.e.
// convert to a char array and add a last NULL element.
nsTArray<nsCString> attrArray;
ParseString(aAttributes, ',', attrArray);
char **attrs = nullptr;
- PRUint32 origLength = attrArray.Length();
+ uint32_t origLength = attrArray.Length();
if (origLength)
{
attrs = static_cast<char **> (NS_Alloc((origLength + 1) * sizeof(char *)));
if (!attrs)
return NS_ERROR_OUT_OF_MEMORY;
- for (PRUint32 i = 0; i < origLength; ++i)
+ for (uint32_t i = 0; i < origLength; ++i)
attrs[i] = ToNewCString(attrArray[i]);
attrs[origLength] = 0;
}
// XXX deal with timeout here
int retVal = ldap_search_ext(mConnectionHandle,
PromiseFlatCString(aBaseDn).get(),
@@ -490,17 +490,17 @@ nsLDAPOperation::SearchExt(const nsACStr
return NS_ERROR_UNEXPECTED;
}
}
return NS_OK;
}
NS_IMETHODIMP
-nsLDAPOperation::GetMessageID(PRInt32 *aMsgID)
+nsLDAPOperation::GetMessageID(int32_t *aMsgID)
{
if (!aMsgID) {
return NS_ERROR_ILLEGAL_VALUE;
}
*aMsgID = mMsgID;
return NS_OK;
@@ -593,42 +593,42 @@ nsLDAPOperation::AddExt(const char *base
{
if (mMessageListener == 0) {
NS_ERROR("nsLDAPOperation::AddExt(): mMessageListener not set");
return NS_ERROR_NOT_INITIALIZED;
}
LDAPMod **attrs = 0;
int retVal = LDAP_SUCCESS;
- PRUint32 modCount = 0;
+ uint32_t modCount = 0;
nsresult rv = mods->GetLength(&modCount);
NS_ENSURE_SUCCESS(rv, rv);
if (mods && modCount) {
attrs = static_cast<LDAPMod **>(nsMemory::Alloc((modCount + 1) *
sizeof(LDAPMod *)));
if (!attrs) {
NS_ERROR("nsLDAPOperation::AddExt: out of memory ");
return NS_ERROR_OUT_OF_MEMORY;
}
nsCAutoString type;
- PRUint32 index;
+ uint32_t index;
for (index = 0; index < modCount && NS_SUCCEEDED(rv); ++index) {
attrs[index] = new LDAPMod();
if (!attrs[index])
return NS_ERROR_OUT_OF_MEMORY;
nsCOMPtr<nsILDAPModification> modif(do_QueryElementAt(mods, index, &rv));
if (NS_FAILED(rv))
break;
#ifdef NS_DEBUG
- PRInt32 operation;
+ int32_t operation;
NS_ASSERTION(NS_SUCCEEDED(modif->GetOperation(&operation)) &&
((operation & ~LDAP_MOD_BVALUES) == LDAP_MOD_ADD),
"AddExt can only add.");
#endif
attrs[index]->mod_op = LDAP_MOD_ADD | LDAP_MOD_BVALUES;
nsresult rv = modif->GetType(type);
@@ -648,17 +648,17 @@ nsLDAPOperation::AddExt(const char *base
retVal = ldap_add_ext(mConnectionHandle, base, attrs,
serverctrls, clientctrls, &mMsgID);
}
else
// reset the modCount so we correctly free the array.
modCount = index;
}
- for (PRUint32 counter = 0; counter < modCount; ++counter)
+ for (uint32_t counter = 0; counter < modCount; ++counter)
delete attrs[counter];
nsMemory::Free(attrs);
return NS_FAILED(rv) ? rv : TranslateLDAPErrorToNSError(retVal);
}
/**
@@ -758,39 +758,39 @@ nsLDAPOperation::ModifyExt(const char *b
{
if (mMessageListener == 0) {
NS_ERROR("nsLDAPOperation::ModifyExt(): mMessageListener not set");
return NS_ERROR_NOT_INITIALIZED;
}
LDAPMod **attrs = 0;
int retVal = 0;
- PRUint32 modCount = 0;
+ uint32_t modCount = 0;
nsresult rv = mods->GetLength(&modCount);
NS_ENSURE_SUCCESS(rv, rv);
if (modCount && mods) {
attrs = static_cast<LDAPMod **>(nsMemory::Alloc((modCount + 1) *
sizeof(LDAPMod *)));
if (!attrs) {
NS_ERROR("nsLDAPOperation::ModifyExt: out of memory ");
return NS_ERROR_OUT_OF_MEMORY;
}
nsCAutoString type;
- PRUint32 index;
+ uint32_t index;
for (index = 0; index < modCount && NS_SUCCEEDED(rv); ++index) {
attrs[index] = new LDAPMod();
if (!attrs[index])
return NS_ERROR_OUT_OF_MEMORY;
nsCOMPtr<nsILDAPModification> modif(do_QueryElementAt(mods, index, &rv));
if (NS_FAILED(rv))
break;
- PRInt32 operation;
+ int32_t operation;
nsresult rv = modif->GetOperation(&operation);
if (NS_FAILED(rv))
break;
attrs[index]->mod_op = operation | LDAP_MOD_BVALUES;
rv = modif->GetType(type);
if (NS_FAILED(rv))
@@ -810,17 +810,17 @@ nsLDAPOperation::ModifyExt(const char *b
serverctrls, clientctrls, &mMsgID);
}
else
// reset the modCount so we correctly free the array.
modCount = index;
}
- for (PRUint32 counter = 0; counter < modCount; ++counter)
+ for (uint32_t counter = 0; counter < modCount; ++counter)
delete attrs[counter];
nsMemory::Free(attrs);
return NS_FAILED(rv) ? rv : TranslateLDAPErrorToNSError(retVal);
}
/**
@@ -930,41 +930,41 @@ nsLDAPOperation::Rename(const nsACString
/* static */
nsresult
nsLDAPOperation::CopyValues(nsILDAPModification* aMod, berval*** aBValues)
{
nsCOMPtr<nsIArray> values;
nsresult rv = aMod->GetValues(getter_AddRefs(values));
NS_ENSURE_SUCCESS(rv, rv);
- PRUint32 valuesCount;
+ uint32_t valuesCount;
rv = values->GetLength(&valuesCount);
NS_ENSURE_SUCCESS(rv, rv);
*aBValues = static_cast<berval **>
(nsMemory::Alloc((valuesCount + 1) *
sizeof(berval *)));
if (!*aBValues)
return NS_ERROR_OUT_OF_MEMORY;
- PRUint32 valueIndex;
+ uint32_t valueIndex;
for (valueIndex = 0; valueIndex < valuesCount; ++valueIndex) {
nsCOMPtr<nsILDAPBERValue> value(do_QueryElementAt(values, valueIndex, &rv));
berval* bval = new berval;
if (NS_FAILED(rv) || !bval) {
- for (PRUint32 counter = 0;
+ for (uint32_t counter = 0;
counter < valueIndex && counter < valuesCount;
++counter)
delete (*aBValues)[valueIndex];
nsMemory::Free(*aBValues);
delete bval;
return NS_ERROR_OUT_OF_MEMORY;
}
- value->Get((PRUint32*)&bval->bv_len,
- (PRUint8**)&bval->bv_val);
+ value->Get((uint32_t*)&bval->bv_len,
+ (uint8_t**)&bval->bv_val);
(*aBValues)[valueIndex] = bval;
}
(*aBValues)[valuesCount] = 0;
return NS_OK;
}
--- a/ldap/xpcom/src/nsLDAPOperation.h
+++ b/ldap/xpcom/src/nsLDAPOperation.h
@@ -89,15 +89,15 @@ class nsLDAPOperation : public nsILDAPOp
nsCOMPtr<nsILDAPMessageListener> mMessageListener; // results go here
nsCOMPtr<nsISupports> mClosure; // private parameter (anything caller desires)
nsRefPtr<nsLDAPConnection> mConnection; // connection this op is on
LDAP *mConnectionHandle; // cache connection handle
nsCString mSavePassword;
nsCString mMechanism;
nsCOMPtr<nsIAuthModule> mAuthModule;
- PRInt32 mMsgID; // opaque handle to outbound message for this op
+ int32_t mMsgID; // opaque handle to outbound message for this op
nsCOMPtr<nsIMutableArray> mClientControls;
nsCOMPtr<nsIMutableArray> mServerControls;
};
#endif // _nsLDAPOperation_h
--- a/ldap/xpcom/src/nsLDAPServer.cpp
+++ b/ldap/xpcom/src/nsLDAPServer.cpp
@@ -71,27 +71,27 @@ NS_IMETHODIMP nsLDAPServer::GetBinddn(ns
}
NS_IMETHODIMP nsLDAPServer::SetBinddn(const nsACString& aBindDN)
{
mBindDN.Assign(aBindDN);
return NS_OK;
}
// attribute unsigned long sizelimit;
-NS_IMETHODIMP nsLDAPServer::GetSizelimit(PRUint32 *_retval)
+NS_IMETHODIMP nsLDAPServer::GetSizelimit(uint32_t *_retval)
{
if (!_retval) {
NS_ERROR("nsLDAPServer::GetSizelimit: null pointer ");
return NS_ERROR_NULL_POINTER;
}
*_retval = mSizeLimit;
return NS_OK;
}
-NS_IMETHODIMP nsLDAPServer::SetSizelimit(PRUint32 aSizeLimit)
+NS_IMETHODIMP nsLDAPServer::SetSizelimit(uint32_t aSizeLimit)
{
mSizeLimit = aSizeLimit;
return NS_OK;
}
// attribute nsILDAPURL url;
NS_IMETHODIMP nsLDAPServer::GetUrl(nsILDAPURL **_retval)
{
@@ -105,27 +105,27 @@ NS_IMETHODIMP nsLDAPServer::GetUrl(nsILD
}
NS_IMETHODIMP nsLDAPServer::SetUrl(nsILDAPURL *aURL)
{
mURL = aURL;
return NS_OK;
}
// attribute long protocolVersion
-NS_IMETHODIMP nsLDAPServer::GetProtocolVersion(PRUint32 *_retval)
+NS_IMETHODIMP nsLDAPServer::GetProtocolVersion(uint32_t *_retval)
{
if (!_retval) {
NS_ERROR("nsLDAPServer::GetProtocolVersion: null pointer ");
return NS_ERROR_NULL_POINTER;
}
*_retval = mProtocolVersion;
return NS_OK;
}
-NS_IMETHODIMP nsLDAPServer::SetProtocolVersion(PRUint32 aVersion)
+NS_IMETHODIMP nsLDAPServer::SetProtocolVersion(uint32_t aVersion)
{
if (aVersion != nsILDAPConnection::VERSION2 &&
aVersion != nsILDAPConnection::VERSION3) {
NS_ERROR("nsLDAPServer::SetProtocolVersion: invalid version");
return NS_ERROR_INVALID_ARG;
}
mProtocolVersion = aVersion;
--- a/ldap/xpcom/src/nsLDAPServer.h
+++ b/ldap/xpcom/src/nsLDAPServer.h
@@ -25,14 +25,14 @@ class nsLDAPServer : public nsILDAPServe
nsLDAPServer();
virtual ~nsLDAPServer();
protected:
nsString mKey; // Unique identifier for this server object
nsCString mUsername; // Username / UID
nsCString mPassword; // Password to bind with
nsCString mBindDN; // DN associated with the UID above
- PRUint32 mSizeLimit; // Limit the LDAP search to this # of entries
- PRUint32 mProtocolVersion; // What version of LDAP to use?
+ uint32_t mSizeLimit; // Limit the LDAP search to this # of entries
+ uint32_t mProtocolVersion; // What version of LDAP to use?
// This "links" to a LDAP URL object, which holds further information
// related to the LDAP server. Like Host, port, base-DN and scope.
nsCOMPtr<nsILDAPURL> mURL;
};
--- a/ldap/xpcom/src/nsLDAPService.cpp
+++ b/ldap/xpcom/src/nsLDAPService.cpp
@@ -69,17 +69,17 @@ bool nsLDAPServiceEntry::DecrementLeases
{
if (!mLeases) {
return false;
}
mLeases--;
return true;
}
-PRUint32 nsLDAPServiceEntry::GetLeases()
+uint32_t nsLDAPServiceEntry::GetLeases()
{
return mLeases;
}
// Get/Set the nsLDAPServer object for this entry.
//
already_AddRefed<nsILDAPServer> nsLDAPServiceEntry::GetServer()
{
@@ -129,17 +129,17 @@ void nsLDAPServiceEntry::SetMessage(nsIL
// Push/Pop pending listeners/callback for this server entry. This is
// implemented as a "stack" on top of the nsVoidArrays, since we can
// potentially have more than one listener waiting for the connection
// to be available for consumption.
//
already_AddRefed<nsILDAPMessageListener> nsLDAPServiceEntry::PopListener()
{
nsILDAPMessageListener *listener;
- PRInt32 count = mListeners.Count();
+ int32_t count = mListeners.Count();
if (!count) {
return 0;
}
listener = mListeners[0];
NS_ADDREF(listener); // keep it alive
mListeners.RemoveObjectAt(0);
@@ -498,17 +498,17 @@ NS_IMETHODIMP nsLDAPService::ReconnectCo
*
* void OnLDAPMessage (in nsILDAPMessage aMessage)
*/
NS_IMETHODIMP
nsLDAPService::OnLDAPMessage(nsILDAPMessage *aMessage)
{
nsCOMPtr<nsILDAPOperation> operation;
nsCOMPtr<nsILDAPConnection> connection;
- PRInt32 messageType;
+ int32_t messageType;
// XXXleif: NULL messages are supposedly allowed, but the semantics
// are not definted (yet?). This is something to look out for...
//
// figure out what sort of message was returned
//
@@ -613,17 +613,17 @@ nsLDAPService::EstablishConnection(nsLDA
{
nsCOMPtr<nsILDAPOperation> operation;
nsCOMPtr<nsILDAPServer> server;
nsCOMPtr<nsILDAPURL> url;
nsCOMPtr<nsILDAPConnection> conn, conn2;
nsCOMPtr<nsILDAPMessage> message;
nsCAutoString binddn;
nsCAutoString password;
- PRUint32 protocolVersion;
+ uint32_t protocolVersion;
nsresult rv;
server = aEntry->GetServer();
if (!server) {
return NS_ERROR_FAILURE;
}
// Get username, password, and protocol version from the server entry.
@@ -747,44 +747,44 @@ nsLDAPService::EstablishConnection(nsLDA
return NS_ERROR_UNEXPECTED;
}
}
return NS_OK;
}
/* AString createFilter (in unsigned long aMaxSize, in AString aPattern, in AString aPrefix, in AString aSuffix, in AString aAttr, in AString aValue); */
-NS_IMETHODIMP nsLDAPService::CreateFilter(PRUint32 aMaxSize,
+NS_IMETHODIMP nsLDAPService::CreateFilter(uint32_t aMaxSize,
const nsACString & aPattern,
const nsACString & aPrefix,
const nsACString & aSuffix,
const nsACString & aAttr,
const nsACString & aValue,
nsACString & _retval)
{
if (!aMaxSize) {
return NS_ERROR_INVALID_ARG;
}
// figure out how big of an array we're going to need for the tokens,
// including a trailing NULL, and allocate space for it.
//
const char *iter = aValue.BeginReading();
const char *iterEnd = aValue.EndReading();
- PRUint32 numTokens = CountTokens(iter, iterEnd);
+ uint32_t numTokens = CountTokens(iter, iterEnd);
char **valueWords;
valueWords = static_cast<char **>(nsMemory::Alloc((numTokens + 1) *
sizeof(char *)));
if (!valueWords) {
return NS_ERROR_OUT_OF_MEMORY;
}
// build the array of values
//
- PRUint32 curToken = 0;
+ uint32_t curToken = 0;
while (iter != iterEnd && curToken < numTokens ) {
valueWords[curToken] = NextToken(&iter, &iterEnd);
if ( !valueWords[curToken] ) {
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(curToken, valueWords);
return NS_ERROR_OUT_OF_MEMORY;
}
curToken++;
}
@@ -842,17 +842,17 @@ NS_IMETHODIMP nsLDAPService::CreateFilte
return rv;
}
// Parse a distinguished name (DN) and returns the relative DN,
// base DN and the list of attributes that make up the relative DN.
NS_IMETHODIMP nsLDAPService::ParseDn(const char *aDn,
nsACString &aRdn,
nsACString &aBaseDn,
- PRUint32 *aRdnCount,
+ uint32_t *aRdnCount,
char ***aRdnAttrs)
{
NS_ENSURE_ARG_POINTER(aRdnCount);
NS_ENSURE_ARG_POINTER(aRdnAttrs);
// explode the DN
char **dnComponents = ldap_explode_dn(aDn, 0);
if (!dnComponents) {
@@ -878,17 +878,17 @@ NS_IMETHODIMP nsLDAPService::ParseDn(con
char **rdnComponents = ldap_explode_rdn(*dnComponents, 0);
if (!rdnComponents) {
NS_ERROR("nsLDAPService::ParseDn: parsing RDN failed");
ldap_value_free(dnComponents);
return NS_ERROR_UNEXPECTED;
}
// count RDN attributes
- PRUint32 rdnCount = 0;
+ uint32_t rdnCount = 0;
for (char **component = rdnComponents; *component; ++component)
++rdnCount;
if (rdnCount < 1) {
NS_ERROR("nsLDAPService::ParseDn: RDN has too few components");
ldap_value_free(dnComponents);
ldap_value_free(rdnComponents);
return NS_ERROR_UNEXPECTED;
}
@@ -897,19 +897,19 @@ NS_IMETHODIMP nsLDAPService::ParseDn(con
char **attrNameArray = static_cast<char **>(
nsMemory::Alloc(rdnCount * sizeof(char *)));
if (!attrNameArray) {
NS_ERROR("nsLDAPService::ParseDn: out of memory ");
ldap_value_free(dnComponents);
ldap_value_free(rdnComponents);
return NS_ERROR_OUT_OF_MEMORY;
}
- PRUint32 index = 0;
+ uint32_t index = 0;
for (char **component = rdnComponents; *component; ++component) {
- PRUint32 len = 0;
+ uint32_t len = 0;
char *p;
for (p = *component; *p != '\0' && *p != '='; ++p)
++len;
if (*p != '=') {
NS_ERROR("nsLDAPService::parseDn: "
"could not find '=' in RDN component");
ldap_value_free(dnComponents);
ldap_value_free(rdnComponents);
@@ -933,21 +933,21 @@ NS_IMETHODIMP nsLDAPService::ParseDn(con
ldap_value_free(dnComponents);
ldap_value_free(rdnComponents);
return NS_OK;
}
// Count the number of space-separated tokens between aIter and aIterEnd
//
-PRUint32
+uint32_t
nsLDAPService::CountTokens(const char *aIter,
const char *aIterEnd)
{
- PRUint32 count(0);
+ uint32_t count(0);
// keep iterating through the string until we hit the end
//
while (aIter != aIterEnd) {
// move past any leading spaces
//
while (aIter != aIterEnd &&
--- a/ldap/xpcom/src/nsLDAPService.h
+++ b/ldap/xpcom/src/nsLDAPService.h
@@ -30,17 +30,17 @@
//
class nsLDAPServiceEntry
{
public:
nsLDAPServiceEntry();
virtual ~nsLDAPServiceEntry() {};
bool Init();
- inline PRUint32 GetLeases();
+ inline uint32_t GetLeases();
inline void IncrementLeases();
inline bool DecrementLeases();
inline PRTime GetTimestamp();
inline void SetTimestamp();
inline already_AddRefed<nsILDAPServer> GetServer();
inline bool SetServer(nsILDAPServer *aServer);
@@ -55,17 +55,17 @@ class nsLDAPServiceEntry
inline bool PushListener(nsILDAPMessageListener *);
inline bool IsRebinding();
inline void SetRebinding(bool);
inline bool DeleteEntry();
protected:
- PRUint32 mLeases; // The number of leases currently granted
+ uint32_t mLeases; // The number of leases currently granted
PRTime mTimestamp; // Last time this server was "used"
bool mDelete; // This entry is due for deletion
bool mRebinding; // Keep state if we are rebinding or not
nsCOMPtr<nsILDAPServer> mServer;
nsCOMPtr<nsILDAPConnection> mConnection;
nsCOMPtr<nsILDAPMessage> mMessage;
@@ -99,17 +99,17 @@ class nsLDAPService : public nsILDAPServ
// createFilter
//
char *NextToken(const char **aIter, const char **aIterEnd);
// count how many tokens are in this string; for use by
// createFilter; note that unlike with NextToken, these params
// are copies, not references.
//
- PRUint32 CountTokens(const char * aIter, const char * aIterEnd);
+ uint32_t CountTokens(const char * aIter, const char * aIterEnd);
mozilla::Mutex mLock; // Lock mechanism
// Hash table holding server entries
nsDataHashtable<nsStringHashKey, nsLDAPServiceEntry*> mServers;
// Hash table holding "reverse" lookups from connection to server
nsDataHashtable<nsVoidPtrHashKey, nsLDAPServiceEntry*> mConnections;
--- a/ldap/xpcom/src/nsLDAPSyncQuery.cpp
+++ b/ldap/xpcom/src/nsLDAPSyncQuery.cpp
@@ -32,17 +32,17 @@ nsLDAPSyncQuery::~nsLDAPSyncQuery()
// Messages received are passed back via this function.
// void OnLDAPMessage (in nsILDAPMessage aMessage)
//
NS_IMETHODIMP
nsLDAPSyncQuery::OnLDAPMessage(nsILDAPMessage *aMessage)
{
- PRInt32 messageType;
+ int32_t messageType;
// just in case.
//
if (!aMessage) {
return NS_OK;
}
// figure out what sort of message was returned
@@ -122,17 +122,17 @@ nsLDAPSyncQuery::OnLDAPInit(nsILDAPConne
return NS_OK;
}
nsresult
nsLDAPSyncQuery::OnLDAPBind(nsILDAPMessage *aMessage)
{
- PRInt32 errCode;
+ int32_t errCode;
mOperation = 0; // done with bind op; make nsCOMPtr release it
// get the status of the bind
//
nsresult rv = aMessage->GetErrorCode(&errCode);
if (NS_FAILED(rv)) {
@@ -153,46 +153,46 @@ nsLDAPSyncQuery::OnLDAPBind(nsILDAPMessa
// ok, we're starting a search
//
return StartLDAPSearch();
}
nsresult
nsLDAPSyncQuery::OnLDAPSearchEntry(nsILDAPMessage *aMessage)
{
- PRUint32 attrCount;
+ uint32_t attrCount;
char** attributes;
nsresult rv = aMessage->GetAttributes(&attrCount, &attributes);
if (NS_FAILED(rv))
{
NS_WARNING("nsLDAPSyncQuery:OnLDAPSearchEntry(): "
"aMessage->GetAttributes() failed");
FinishLDAPQuery();
return rv;
}
// Iterate through the attributes received in this message
- for (PRUint32 i = 0; i < attrCount; i++)
+ for (uint32_t i = 0; i < attrCount; i++)
{
PRUnichar **vals;
- PRUint32 valueCount;
+ uint32_t valueCount;
// Get the values of this attribute.
// XXX better failure handling
rv = aMessage->GetValues(attributes[i], &valueCount, &vals);
if (NS_FAILED(rv))
{
NS_WARNING("nsLDAPSyncQuery:OnLDAPSearchEntry(): "
"aMessage->GetValues() failed\n");
FinishLDAPQuery();
break;
}
// Store all values of this attribute in the mResults.
- for (PRUint32 j = 0; j < valueCount; j++) {
+ for (uint32_t j = 0; j < valueCount; j++) {
mResults.Append(PRUnichar('\n'));
mResults.AppendASCII(attributes[i]);
mResults.Append(PRUnichar('='));
mResults.Append(vals[j]);
}
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(valueCount, vals);
}
@@ -253,17 +253,17 @@ nsLDAPSyncQuery::StartLDAPSearch()
rv = mServerURL->GetDn(dn);
if (NS_FAILED(rv)) {
FinishLDAPQuery();
return NS_ERROR_UNEXPECTED;
}
// and the scope
//
- PRInt32 scope;
+ int32_t scope;
rv = mServerURL->GetScope(&scope);
if (NS_FAILED(rv)) {
FinishLDAPQuery();
return NS_ERROR_UNEXPECTED;
}
nsCAutoString attributes;
rv = mServerURL->GetAttributes(attributes);
@@ -333,17 +333,17 @@ nsLDAPSyncQuery::FinishLDAPQuery()
mConnection = 0;
mOperation = 0;
mServerURL = 0;
}
/* wstring getQueryResults (in nsILDAPURL aServerURL, in unsigned long aVersion); */
NS_IMETHODIMP nsLDAPSyncQuery::GetQueryResults(nsILDAPURL *aServerURL,
- PRUint32 aProtocolVersion,
+ uint32_t aProtocolVersion,
PRUnichar **_retval)
{
nsresult rv;
if (!aServerURL) {
NS_ERROR("nsLDAPSyncQuery::GetQueryResults() called without LDAP URL");
return NS_ERROR_FAILURE;
}
--- a/ldap/xpcom/src/nsLDAPSyncQuery.h
+++ b/ldap/xpcom/src/nsLDAPSyncQuery.h
@@ -32,17 +32,17 @@ class nsLDAPSyncQuery : public nsILDAPSy
protected:
nsCOMPtr<nsILDAPConnection> mConnection; // connection used for search
nsCOMPtr<nsILDAPOperation> mOperation; // current ldap op
nsCOMPtr<nsILDAPURL> mServerURL; // LDAP URL
bool mFinished; // control variable for eventQ
nsString mResults; // values to return
- PRUint32 mProtocolVersion; // LDAP version to use
+ uint32_t mProtocolVersion; // LDAP version to use
nsresult InitConnection();
// check that we bound ok and start then call StartLDAPSearch
nsresult OnLDAPBind(nsILDAPMessage *aMessage);
// add to the results set
nsresult OnLDAPSearchEntry(nsILDAPMessage *aMessage);
--- a/ldap/xpcom/src/nsLDAPURL.cpp
+++ b/ldap/xpcom/src/nsLDAPURL.cpp
@@ -26,17 +26,17 @@ nsLDAPURL::nsLDAPURL()
{
}
nsLDAPURL::~nsLDAPURL()
{
}
nsresult
-nsLDAPURL::Init(PRUint32 aUrlType, PRInt32 aDefaultPort,
+nsLDAPURL::Init(uint32_t aUrlType, int32_t aDefaultPort,
const nsACString &aSpec, const char* aOriginCharset,
nsIURI *aBaseURI)
{
if (!mBaseURL)
{
mBaseURL = do_CreateInstance(NS_STANDARDURL_CONTRACTID);
if (!mBaseURL)
return NS_ERROR_OUT_OF_MEMORY;
@@ -273,26 +273,26 @@ nsLDAPURL::SetHost(const nsACString &aHo
{
if (!mBaseURL)
return NS_ERROR_NOT_INITIALIZED;
return mBaseURL->SetHost(aHost);
}
NS_IMETHODIMP
-nsLDAPURL::GetPort(PRInt32 *_retval)
+nsLDAPURL::GetPort(int32_t *_retval)
{
if (!mBaseURL)
return NS_ERROR_NOT_INITIALIZED;
return mBaseURL->GetPort(_retval);
}
NS_IMETHODIMP
-nsLDAPURL::SetPort(PRInt32 aPort)
+nsLDAPURL::SetPort(int32_t aPort)
{
if (!mBaseURL)
return NS_ERROR_NOT_INITIALIZED;
return mBaseURL->SetPort(aPort);
}
NS_IMETHODIMP nsLDAPURL::GetPath(nsACString &_retval)
@@ -346,17 +346,17 @@ NS_IMETHODIMP nsLDAPURL::Equals(nsIURI *
*_retval = false;
if (other)
{
nsresult rv;
nsCOMPtr<nsILDAPURL> otherURL(do_QueryInterface(other, &rv));
if (NS_SUCCEEDED(rv))
{
nsCAutoString thisSpec, otherSpec;
- PRUint32 otherOptions;
+ uint32_t otherOptions;
rv = GetSpec(thisSpec);
NS_ENSURE_SUCCESS(rv, rv);
rv = otherURL->GetSpec(otherSpec);
NS_ENSURE_SUCCESS(rv, rv);
rv = otherURL->GetOptions(&otherOptions);
@@ -516,17 +516,17 @@ NS_IMETHODIMP nsLDAPURL::AddAttribute(co
// Wrap the attribute in commas, so that we can do an exact match.
nsCAutoString findAttribute(",");
findAttribute.Append(aAttribute);
findAttribute.Append(',');
// Check to see if the attribute is already stored. If it is, then also
// check to see if it is the last attribute in the string, or if the next
// character is a comma, this means we won't match substrings.
- PRInt32 pos = mAttributes.Find(findAttribute, CaseInsensitiveCompare);
+ int32_t pos = mAttributes.Find(findAttribute, CaseInsensitiveCompare);
if (pos != -1)
return NS_OK;
mAttributes.Append(Substring(findAttribute, 1));
}
// Now get the current path
nsCString newPath;
@@ -547,17 +547,17 @@ NS_IMETHODIMP nsLDAPURL::RemoveAttribute
nsCAutoString findAttribute(",");
findAttribute.Append(aAttribute);
findAttribute.Append(',');
if (mAttributes.Equals(findAttribute, nsCaseInsensitiveCStringComparator()))
mAttributes.Truncate();
else
{
- PRInt32 pos = mAttributes.Find(findAttribute, CaseInsensitiveCompare);
+ int32_t pos = mAttributes.Find(findAttribute, CaseInsensitiveCompare);
if (pos == -1)
return NS_OK;
mAttributes.Cut(pos, findAttribute.Length() - 1);
}
// Now get the current path
nsCString newPath;
@@ -575,24 +575,24 @@ NS_IMETHODIMP nsLDAPURL::HasAttribute(co
nsCAutoString findAttribute(",");
findAttribute.Append(aAttribute);
findAttribute.Append(',');
*_retval = mAttributes.Find(findAttribute, CaseInsensitiveCompare) != -1;
return NS_OK;
}
-NS_IMETHODIMP nsLDAPURL::GetScope(PRInt32 *_retval)
+NS_IMETHODIMP nsLDAPURL::GetScope(int32_t *_retval)
{
NS_ENSURE_ARG_POINTER(_retval);
*_retval = mScope;
return NS_OK;
}
-NS_IMETHODIMP nsLDAPURL::SetScope(PRInt32 aScope)
+NS_IMETHODIMP nsLDAPURL::SetScope(int32_t aScope)
{
if (!mBaseURL)
return NS_ERROR_NOT_INITIALIZED;
// Only allow scopes supported by the C-SDK
if ((aScope != SCOPE_BASE) && (aScope != SCOPE_ONELEVEL) &&
(aScope != SCOPE_SUBTREE))
return NS_ERROR_MALFORMED_URI;
@@ -625,24 +625,24 @@ NS_IMETHODIMP nsLDAPURL::SetFilter(const
// Now get the current path
nsCString newPath;
GetPathInternal(newPath);
// and update the base url
return mBaseURL->SetPath(newPath);
}
-NS_IMETHODIMP nsLDAPURL::GetOptions(PRUint32 *_retval)
+NS_IMETHODIMP nsLDAPURL::GetOptions(uint32_t *_retval)
{
NS_ENSURE_ARG_POINTER(_retval);
*_retval = mOptions;
return NS_OK;
}
-NS_IMETHODIMP nsLDAPURL::SetOptions(PRUint32 aOptions)
+NS_IMETHODIMP nsLDAPURL::SetOptions(uint32_t aOptions)
{
// Secure is the only option supported at the moment
if (mOptions & OPT_SECURE == aOptions & OPT_SECURE)
return NS_OK;
mOptions = aOptions;
if (aOptions & OPT_SECURE == OPT_SECURE)
--- a/ldap/xpcom/src/nsLDAPURL.h
+++ b/ldap/xpcom/src/nsLDAPURL.h
@@ -41,14 +41,14 @@ public:
protected:
void GetPathInternal(nsCString &aPath);
nsresult SetPathInternal(const nsCString &aPath);
nsresult SetAttributeArray(char** aAttributes);
nsCString mDN; // Base Distinguished Name (Base DN)
- PRInt32 mScope; // Search scope (base, one or sub)
+ int32_t mScope; // Search scope (base, one or sub)
nsCString mFilter; // LDAP search filter
- PRUint32 mOptions; // Options
+ uint32_t mOptions; // Options
nsCString mAttributes;
nsCOMPtr<nsIURI> mBaseURL;
};
--- a/ldap/xpcom/src/nsLDAPUtils.h
+++ b/ldap/xpcom/src/nsLDAPUtils.h
@@ -40,17 +40,17 @@ inline void LdapCompressWhitespace(nsCSt
if (!IS_SPACE(*(cur + 1)))
continue;
// Loop through the white space
char *wend = cur + 2;
while (IS_SPACE(*wend))
++wend;
- PRUint32 wlen = wend - cur - 1;
+ uint32_t wlen = wend - cur - 1;
// fix "end"
end -= wlen;
// move everything forwards a bit
for (char *m = cur + 1; m < end; ++m) {
*m = *(m + wlen);
}
@@ -64,27 +64,27 @@ inline void LdapCompressWhitespace(nsCSt
* Function copied from nsReadableUtils.
* Migrating to frozen linkage is the only change done
*/
inline
bool IsUTF8(const nsACString& aString)
{
const char *done_reading = aString.EndReading();
- PRInt32 state = 0;
+ int32_t state = 0;
bool overlong = false;
bool surrogate = false;
bool nonchar = false;
- PRUint16 olupper = 0; // overlong byte upper bound.
- PRUint16 slower = 0; // surrogate byte lower bound.
+ uint16_t olupper = 0; // overlong byte upper bound.
+ uint16_t slower = 0; // surrogate byte lower bound.
const char *ptr = aString.BeginReading();
while (ptr < done_reading) {
- PRUint8 c;
+ uint8_t c;
if (0 == state) {
c = *ptr++;
if ((c & 0x80) == 0x00)
continue;
--- a/mail/components/cloudfile/nsIMsgCloudFileProvider.idl
+++ b/mail/components/cloudfile/nsIMsgCloudFileProvider.idl
@@ -115,17 +115,17 @@ interface nsIMsgCloudFileProvider : nsIS
/// -1 if we don't have this info
readonly attribute long long remainingFileSpace;
/// -1 if we don't have this info
readonly attribute long long fileSpaceUsed;
/// This is used by our test harness to override the urls the provider uses.
- void overrideUrls(in PRUint32 aNumUrls, [array, size_is(aNumUrls)] in string aUrls);
+ void overrideUrls(in uint32_t aNumUrls, [array, size_is(aNumUrls)] in string aUrls);
// Error handling
// If the cloud provider gets textual errors back from the server,
// they can be retrieved here.
readonly attribute ACString lastError;
// I'm mapping these to real NS_MSG error codes where possible,
// but it really doesn't matter as long as we only return these
// errors.
--- a/mail/components/migration/src/nsEudoraProfileMigrator.cpp
+++ b/mail/components/migration/src/nsEudoraProfileMigrator.cpp
@@ -38,17 +38,17 @@ nsresult nsEudoraProfileMigrator::Contin
}
///////////////////////////////////////////////////////////////////////////////
// nsITimerCallback
NS_IMETHODIMP
nsEudoraProfileMigrator::Notify(nsITimer *timer)
{
- PRInt32 progress;
+ int32_t progress;
mGenericImporter->GetProgress(&progress);
nsAutoString index;
index.AppendInt( progress );
NOTIFY_OBSERVERS(MIGRATION_PROGRESS, index.get());
if (progress == 100) // are we done yet?
{
@@ -66,17 +66,17 @@ nsEudoraProfileMigrator::Notify(nsITimer
}
return NS_OK;
}
///////////////////////////////////////////////////////////////////////////////
// nsIMailProfileMigrator
NS_IMETHODIMP
-nsEudoraProfileMigrator::Migrate(PRUint16 aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile)
+nsEudoraProfileMigrator::Migrate(uint16_t aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile)
{
nsresult rv = NS_OK;
if (aStartup)
{
rv = aStartup->DoStartup();
NS_ENSURE_SUCCESS(rv, rv);
}
@@ -91,17 +91,17 @@ nsEudoraProfileMigrator::Migrate(PRUint1
// don't broadcast an on end migration here. We aren't done until our asynch import process says we are done.
return rv;
}
NS_IMETHODIMP
nsEudoraProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
bool aReplace,
- PRUint16* aResult)
+ uint16_t* aResult)
{
// There's no harm in assuming everything is available.
*aResult = nsIMailProfileMigrator::ACCOUNT_SETTINGS | nsIMailProfileMigrator::ADDRESSBOOK_DATA |
nsIMailProfileMigrator::MAILDATA | nsIMailProfileMigrator::FILTERS;
return NS_OK;
}
NS_IMETHODIMP
--- a/mail/components/migration/src/nsMailProfileMigratorUtils.cpp
+++ b/mail/components/migration/src/nsMailProfileMigratorUtils.cpp
@@ -11,56 +11,56 @@
#include "nsServiceManagerUtils.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsXPCOMCID.h"
void SetProxyPref(const nsACString& aHostPort, const char* aPref,
const char* aPortPref, nsIPrefBranch* aPrefs)
{
nsCAutoString hostPort(aHostPort);
- PRInt32 portDelimOffset = hostPort.RFindChar(':');
+ int32_t portDelimOffset = hostPort.RFindChar(':');
if (portDelimOffset > 0) {
nsCAutoString host(Substring(hostPort, 0, portDelimOffset));
nsCAutoString port(Substring(hostPort, portDelimOffset + 1,
hostPort.Length() - (portDelimOffset + 1)));
aPrefs->SetCharPref(aPref, host.get());
nsresult stringErr;
- PRInt32 portValue = port.ToInteger(&stringErr);
+ int32_t portValue = port.ToInteger(&stringErr);
aPrefs->SetIntPref(aPortPref, portValue);
}
else
aPrefs->SetCharPref(aPref, hostPort.get());
}
void ParseOverrideServers(const char* aServers, nsIPrefBranch* aBranch)
{
// Windows (and Opera) formats its proxy override list in the form:
// server;server;server where server is a server name or ip address,
// or "<local>". Mozilla's format is server,server,server, and <local>
// must be translated to "localhost,127.0.0.1"
nsCAutoString override(aServers);
- PRInt32 left = 0, right = 0;
+ int32_t left = 0, right = 0;
for (;;) {
right = override.FindChar(';', right);
const nsACString& host = Substring(override, left,
(right < 0 ? override.Length() : right) - left);
if (host.Equals("<local>"))
override.Replace(left, 7, NS_LITERAL_CSTRING("localhost,127.0.0.1"));
if (right < 0)
break;
left = right + 1;
override.Replace(right, 1, NS_LITERAL_CSTRING(","));
}
aBranch->SetCharPref("network.proxy.no_proxies_on", override.get());
}
-void GetMigrateDataFromArray(MigrationData* aDataArray, PRInt32 aDataArrayLength,
+void GetMigrateDataFromArray(MigrationData* aDataArray, int32_t aDataArrayLength,
bool aReplace, nsIFile* aSourceProfile,
- PRUint16* aResult)
+ uint16_t* aResult)
{
nsCOMPtr<nsIFile> sourceFile;
bool exists;
MigrationData* cursor;
MigrationData* end = aDataArray + aDataArrayLength;
for (cursor = aDataArray; cursor < end && cursor->fileName; ++cursor) {
// When in replace mode, all items can be imported.
// When in non-replace mode, only items that do not require file replacement
--- a/mail/components/migration/src/nsMailProfileMigratorUtils.h
+++ b/mail/components/migration/src/nsMailProfileMigratorUtils.h
@@ -32,26 +32,26 @@ class nsIProfileStartup;
// Proxy utilities shared by the Opera and IE migrators
void ParseOverrideServers(const char* aServers, nsIPrefBranch* aBranch);
void SetProxyPref(const nsACString& aHostPort, const char* aPref,
const char* aPortPref, nsIPrefBranch* aPrefs);
struct MigrationData {
PRUnichar* fileName;
- PRUint32 sourceFlag;
+ uint32_t sourceFlag;
bool replaceOnly;
};
class nsIFile;
void GetMigrateDataFromArray(MigrationData* aDataArray,
- PRInt32 aDataArrayLength,
+ int32_t aDataArrayLength,
bool aReplace,
nsIFile* aSourceProfile,
- PRUint16* aResult);
+ uint16_t* aResult);
// get the base directory of the *target* profile
// this is already cloned, modify it to your heart's content
void GetProfilePath(nsIProfileStartup* aStartup, nsCOMPtr<nsIFile>& aProfileDir);
#endif
--- a/mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
+++ b/mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
@@ -352,21 +352,21 @@ void nsNetscapeProfileMigratorBase::Copy
fileTransactionEntry fileTransaction =
mFileCopyTransactions.ElementAt(mFileCopyTransactionIndex++);
// copy the file
fileTransaction.srcFile->CopyTo(fileTransaction.destFile,
fileTransaction.newName);
// add to our current progress
- PRInt64 fileSize;
+ int64_t fileSize;
fileTransaction.srcFile->GetFileSize(&fileSize);
mCurrentProgress += fileSize;
- PRUint32 percentage = (PRUint32)(mCurrentProgress * 100 / mMaxProgress);
+ uint32_t percentage = (uint32_t)(mCurrentProgress * 100 / mMaxProgress);
nsAutoString index;
index.AppendInt(percentage);
NOTIFY_OBSERVERS(MIGRATION_PROGRESS, index.get());
// fire a timer to handle the next one.
mFileIOTimer = do_CreateInstance("@mozilla.org/timer;1");
@@ -394,34 +394,34 @@ void nsNetscapeProfileMigratorBase::EndC
NS_IMETHODIMP
nsNetscapeProfileMigratorBase::GetSourceHasMultipleProfiles(bool* aResult)
{
nsCOMPtr<nsIArray> profiles;
GetSourceProfiles(getter_AddRefs(profiles));
if (profiles) {
- PRUint32 count;
+ uint32_t count;
profiles->GetLength(&count);
*aResult = count > 1;
}
else
*aResult = false;
return NS_OK;
}
NS_IMETHODIMP
nsNetscapeProfileMigratorBase::GetSourceExists(bool* aResult)
{
nsCOMPtr<nsIArray> profiles;
GetSourceProfiles(getter_AddRefs(profiles));
if (profiles) {
- PRUint32 count;
+ uint32_t count;
profiles->GetLength(&count);
*aResult = count > 0;
}
else
*aResult = false;
return NS_OK;
}
--- a/mail/components/migration/src/nsNetscapeProfileMigratorBase.h
+++ b/mail/components/migration/src/nsNetscapeProfileMigratorBase.h
@@ -50,28 +50,28 @@ public:
struct PrefTransform {
const char* sourcePrefName;
const char* targetPrefName;
prefConverter prefGetterFunc;
prefConverter prefSetterFunc;
bool prefHasValue;
union {
- PRInt32 intValue;
+ int32_t intValue;
bool boolValue;
char* stringValue;
};
};
struct PrefBranchStruct {
char* prefName;
- PRInt32 type;
+ int32_t type;
union {
char* stringValue;
- PRInt32 intValue;
+ int32_t intValue;
bool boolValue;
};
};
typedef nsTArray<PrefBranchStruct*> PBStructArray;
static nsresult GetString(PrefTransform* aTransform, nsIPrefBranch* aBranch);
static nsresult SetString(PrefTransform* aTransform, nsIPrefBranch* aBranch);
@@ -96,18 +96,18 @@ protected:
nsresult LocateSignonsFile(char** aResult);
nsCOMPtr<nsIFile> mSourceProfile;
nsCOMPtr<nsIFile> mTargetProfile;
// List of src/destination files we still have to copy into the new profile
// directory.
nsTArray<fileTransactionEntry> mFileCopyTransactions;
- PRUint32 mFileCopyTransactionIndex;
+ uint32_t mFileCopyTransactionIndex;
- PRInt64 mMaxProgress;
- PRInt64 mCurrentProgress;
+ int64_t mMaxProgress;
+ int64_t mCurrentProgress;
nsCOMPtr<nsIObserverService> mObserverService;
nsCOMPtr<nsITimer> mFileIOTimer;
};
#endif
--- a/mail/components/migration/src/nsOEProfileMigrator.cpp
+++ b/mail/components/migration/src/nsOEProfileMigrator.cpp
@@ -35,17 +35,17 @@ nsresult nsOEProfileMigrator::ContinueIm
}
///////////////////////////////////////////////////////////////////////////////
// nsITimerCallback
NS_IMETHODIMP
nsOEProfileMigrator::Notify(nsITimer *timer)
{
- PRInt32 progress;
+ int32_t progress;
mGenericImporter->GetProgress(&progress);
nsAutoString index;
index.AppendInt( progress );
NOTIFY_OBSERVERS(MIGRATION_PROGRESS, index.get());
if (progress == 100) // are we done yet?
{
@@ -63,17 +63,17 @@ nsOEProfileMigrator::Notify(nsITimer *ti
}
return NS_OK;
}
///////////////////////////////////////////////////////////////////////////////
// nsIMailProfileMigrator
NS_IMETHODIMP
-nsOEProfileMigrator::Migrate(PRUint16 aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile)
+nsOEProfileMigrator::Migrate(uint16_t aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile)
{
nsresult rv = NS_OK;
if (aStartup)
{
rv = aStartup->DoStartup();
NS_ENSURE_SUCCESS(rv, rv);
}
@@ -88,17 +88,17 @@ nsOEProfileMigrator::Migrate(PRUint16 aI
// don't broadcast an on end migration here. We aren't done until our asynch import process says we are done.
return rv;
}
NS_IMETHODIMP
nsOEProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
bool aReplace,
- PRUint16* aResult)
+ uint16_t* aResult)
{
// There's no harm in assuming everything is available.
*aResult = nsIMailProfileMigrator::ACCOUNT_SETTINGS | nsIMailProfileMigrator::ADDRESSBOOK_DATA |
nsIMailProfileMigrator::MAILDATA;
return NS_OK;
}
NS_IMETHODIMP
--- a/mail/components/migration/src/nsOutlookProfileMigrator.cpp
+++ b/mail/components/migration/src/nsOutlookProfileMigrator.cpp
@@ -30,17 +30,17 @@ nsresult nsOutlookProfileMigrator::Conti
}
///////////////////////////////////////////////////////////////////////////////
// nsITimerCallback
NS_IMETHODIMP
nsOutlookProfileMigrator::Notify(nsITimer *timer)
{
- PRInt32 progress;
+ int32_t progress;
mGenericImporter->GetProgress(&progress);
nsAutoString index;
index.AppendInt( progress );
NOTIFY_OBSERVERS(MIGRATION_PROGRESS, index.get());
if (progress == 100) // are we done yet?
{
@@ -58,17 +58,17 @@ nsOutlookProfileMigrator::Notify(nsITime
}
return NS_OK;
}
///////////////////////////////////////////////////////////////////////////////
// nsIMailProfileMigrator
NS_IMETHODIMP
-nsOutlookProfileMigrator::Migrate(PRUint16 aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile)
+nsOutlookProfileMigrator::Migrate(uint16_t aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile)
{
nsresult rv = NS_OK;
if (aStartup)
{
rv = aStartup->DoStartup();
NS_ENSURE_SUCCESS(rv, rv);
}
@@ -82,17 +82,17 @@ nsOutlookProfileMigrator::Migrate(PRUint
// the final migration step, copying the mail folders over.
rv = ImportAddressBook(mImportModule);
// don't broadcast an on end migration here. We aren't done until our asynch import process says we are done.
return rv;
}
NS_IMETHODIMP
-nsOutlookProfileMigrator::GetMigrateData(const PRUnichar* aProfile, bool aReplace, PRUint16* aResult)
+nsOutlookProfileMigrator::GetMigrateData(const PRUnichar* aProfile, bool aReplace, uint16_t* aResult)
{
// There's no harm in assuming everything is available.
*aResult = nsIMailProfileMigrator::ACCOUNT_SETTINGS | nsIMailProfileMigrator::ADDRESSBOOK_DATA |
nsIMailProfileMigrator::MAILDATA;
return NS_OK;
}
NS_IMETHODIMP
--- a/mail/components/migration/src/nsProfileMigrator.cpp
+++ b/mail/components/migration/src/nsProfileMigrator.cpp
@@ -111,17 +111,17 @@ nsProfileMigrator::GetDefaultMailMigrato
#define MAX_SOURCE_LENGTH 10
const char sources[][MAX_SOURCE_LENGTH] = {
"seamonkey",
"oexpress",
"outlook",
"eudora",
""
};
- for (PRUint32 i = 0; sources[i][0]; ++i)
+ for (uint32_t i = 0; sources[i][0]; ++i)
{
migratorID = migratorPrefix;
migratorID.Append(sources[i]);
mailMigrator = do_CreateInstance(migratorID.get());
if (!mailMigrator)
continue;
bool exists = false;
--- a/mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
+++ b/mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
@@ -30,20 +30,20 @@
#define FILE_NAME_KEY3DB NS_LITERAL_STRING("key3.db")
#define FILE_NAME_SECMODDB NS_LITERAL_STRING("secmod.db")
#define FILE_NAME_MIMETYPES NS_LITERAL_STRING("mimeTypes.rdf")
#define FILE_NAME_PREFS NS_LITERAL_STRING("prefs.js")
#define FILE_NAME_USER_PREFS NS_LITERAL_STRING("user.js")
struct PrefBranchStruct {
char* prefName;
- PRInt32 type;
+ int32_t type;
union {
char* stringValue;
- PRInt32 intValue;
+ int32_t intValue;
bool boolValue;
PRUnichar* wstringValue;
};
};
NS_IMPL_ISUPPORTS2(nsSeamonkeyProfileMigrator, nsIMailProfileMigrator, nsITimerCallback)
@@ -54,17 +54,17 @@ nsSeamonkeyProfileMigrator::nsSeamonkeyP
nsSeamonkeyProfileMigrator::~nsSeamonkeyProfileMigrator()
{
}
///////////////////////////////////////////////////////////////////////////////
// nsIMailProfileMigrator
NS_IMETHODIMP
-nsSeamonkeyProfileMigrator::Migrate(PRUint16 aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile)
+nsSeamonkeyProfileMigrator::Migrate(uint16_t aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile)
{
nsresult rv = NS_OK;
bool aReplace = aStartup ? true : false;
if (!mTargetProfile) {
GetProfilePath(aStartup, mTargetProfile);
if (!mTargetProfile) return NS_ERROR_FAILURE;
}
@@ -90,34 +90,34 @@ nsSeamonkeyProfileMigrator::Migrate(PRUi
// we want to do this last and it will be asynchronous so the UI doesn't freeze up while we perform
// this potentially very long operation.
nsAutoString index;
index.AppendInt(nsIMailProfileMigrator::MAILDATA);
NOTIFY_OBSERVERS(MIGRATION_ITEMBEFOREMIGRATE, index.get());
// Generate the max progress value now that we know all of the files we need to copy
- PRUint32 count = mFileCopyTransactions.Length();
- for (PRUint32 i = 0; i < count; ++i)
+ uint32_t count = mFileCopyTransactions.Length();
+ for (uint32_t i = 0; i < count; ++i)
{
fileTransactionEntry fileTransaction = mFileCopyTransactions.ElementAt(i);
- PRInt64 fileSize;
+ int64_t fileSize;
fileTransaction.srcFile->GetFileSize(&fileSize);
mMaxProgress += fileSize;
}
CopyNextFolder();
return rv;
}
NS_IMETHODIMP
nsSeamonkeyProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
bool aReplace,
- PRUint16* aResult)
+ uint16_t* aResult)
{
*aResult = 0;
if (!mSourceProfile) {
GetSourceProfile(aProfile);
if (!mSourceProfile)
return NS_ERROR_FILE_NOT_FOUND;
}
@@ -182,19 +182,19 @@ nsSeamonkeyProfileMigrator::GetSourcePro
}
///////////////////////////////////////////////////////////////////////////////
// nsSeamonkeyProfileMigrator
nsresult
nsSeamonkeyProfileMigrator::GetSourceProfile(const PRUnichar* aProfile)
{
- PRUint32 count;
+ uint32_t count;
mProfileNames->GetLength(&count);
- for (PRUint32 i = 0; i < count; ++i) {
+ for (uint32_t i = 0; i < count; ++i) {
nsCOMPtr<nsISupportsString> str(do_QueryElementAt(mProfileNames, i));
nsString profileName;
str->GetData(profileName);
if (profileName.Equals(aProfile)) {
mSourceProfile = do_QueryElementAt(mProfileLocations, i);
break;
}
}
@@ -341,17 +341,17 @@ nsSeamonkeyProfileMigrator::TransformPre
"mail.account.",
"mail.smtpserver.",
"mailnews.labels.",
"mailnews.tags."
};
// read in the various pref branch trees for accounts, identities, servers, etc.
PBStructArray branches[NS_ARRAY_LENGTH(branchNames)];
- PRUint32 i;
+ uint32_t i;
for (i = 0; i < NS_ARRAY_LENGTH(branchNames); ++i)
ReadBranch(branchNames[i], psvc, branches[i]);
// The signature file prefs may be paths to files in the seamonkey profile
// path so we need to copy them over and fix these paths up before we write
// them out to the new prefs.js.
CopySignatureFiles(branches[0], psvc);
@@ -387,18 +387,18 @@ nsSeamonkeyProfileMigrator::CopyAddressB
nsIPrefService* aPrefService)
{
// each server has a pref ending with .filename. The value of that pref points to a profile which we
// need to migrate.
nsAutoString index;
index.AppendInt(nsIMailProfileMigrator::ADDRESSBOOK_DATA);
NOTIFY_OBSERVERS(MIGRATION_ITEMBEFOREMIGRATE, index.get());
- PRUint32 count = aLdapServers.Length();
- for (PRUint32 i = 0; i < count; ++i)
+ uint32_t count = aLdapServers.Length();
+ for (uint32_t i = 0; i < count; ++i)
{
PrefBranchStruct* pref = aLdapServers.ElementAt(i);
nsDependentCString prefName(pref->prefName);
if (StringEndsWith(prefName, nsDependentCString(".filename")))
{
NS_ConvertUTF8toUTF16 fileName(pref->stringValue);
CopyFile(fileName, fileName);
@@ -413,18 +413,18 @@ nsSeamonkeyProfileMigrator::CopyAddressB
nsresult
nsSeamonkeyProfileMigrator::CopySignatureFiles(PBStructArray &aIdentities,
nsIPrefService* aPrefService)
{
nsresult rv = NS_OK;
- PRUint32 count = aIdentities.Length();
- for (PRUint32 i = 0; i < count; ++i)
+ uint32_t count = aIdentities.Length();
+ for (uint32_t i = 0; i < count; ++i)
{
PrefBranchStruct* pref = aIdentities.ElementAt(i);
nsDependentCString prefName(pref->prefName);
// a partial fix for bug #255043
// if the user's signature file from seamonkey lives in the
// seamonkey profile root, we'll copy it over to the new
// thunderbird profile root and thenn set the pref to the new value
@@ -468,18 +468,18 @@ nsSeamonkeyProfileMigrator::CopyMailFold
{
// Each server has a .directory pref which points to the location of the mail data
// for that server. We need to do two things for that case...
// (1) Fix up the directory path for the new profile
// (2) copy the mail folder data from the source directory pref to the destination directory pref
nsresult rv = NS_OK;
- PRUint32 count = aMailServers.Length();
- for (PRUint32 i = 0; i < count; ++i)
+ uint32_t count = aMailServers.Length();
+ for (uint32_t i = 0; i < count; ++i)
{
PrefBranchStruct* pref = aMailServers.ElementAt(i);
nsDependentCString prefName(pref->prefName);
if (StringEndsWith(prefName, NS_LITERAL_CSTRING(".directory-rel"))) {
// When the directories are modified below, we may change the .directory
// pref. As we don't have a pref branch to modify at this stage and set
// up the relative folders properly, we'll just remove all the
@@ -637,26 +637,26 @@ void
nsSeamonkeyProfileMigrator::ReadBranch(const char *branchName,
nsIPrefService* aPrefService,
PBStructArray &aPrefs)
{
// Enumerate the branch
nsCOMPtr<nsIPrefBranch> branch;
aPrefService->GetBranch(branchName, getter_AddRefs(branch));
- PRUint32 count;
+ uint32_t count;
char** prefs = nullptr;
nsresult rv = branch->GetChildList("", &count, &prefs);
if (NS_FAILED(rv))
return;
- for (PRUint32 i = 0; i < count; ++i) {
+ for (uint32_t i = 0; i < count; ++i) {
// Save each pref's value into an array
char* currPref = prefs[i];
- PRInt32 type;
+ int32_t type;
branch->GetPrefType(currPref, &type);
PrefBranchStruct* pref = new PrefBranchStruct;
pref->prefName = currPref;
pref->type = type;
switch (type) {
case nsIPrefBranch::PREF_STRING:
rv = branch->GetCharPref(currPref, &pref->stringValue);
break;
@@ -683,18 +683,18 @@ nsSeamonkeyProfileMigrator::WriteBranch(
PBStructArray &aPrefs)
{
nsresult rv;
// Enumerate the branch
nsCOMPtr<nsIPrefBranch> branch;
aPrefService->GetBranch(branchName, getter_AddRefs(branch));
- PRUint32 count = aPrefs.Length();
- for (PRUint32 i = 0; i < count; ++i) {
+ uint32_t count = aPrefs.Length();
+ for (uint32_t i = 0; i < count; ++i) {
PrefBranchStruct* pref = aPrefs.ElementAt(i);
switch (pref->type) {
case nsIPrefBranch::PREF_STRING:
rv = branch->SetCharPref(pref->prefName, pref->stringValue);
NS_Free(pref->stringValue);
pref->stringValue = nullptr;
break;
case nsIPrefBranch::PREF_BOOL:
--- a/mail/components/migration/src/nsSeamonkeyProfileMigrator.h
+++ b/mail/components/migration/src/nsSeamonkeyProfileMigrator.h
@@ -17,20 +17,20 @@ class nsSeamonkeyProfileMigrator : publi
{
public:
NS_DECL_ISUPPORTS
nsSeamonkeyProfileMigrator();
virtual ~nsSeamonkeyProfileMigrator();
// nsIMailProfileMigrator methods
- NS_IMETHOD Migrate(PRUint16 aItems, nsIProfileStartup* aStartup,
+ NS_IMETHOD Migrate(uint16_t aItems, nsIProfileStartup* aStartup,
const PRUnichar* aProfile);
NS_IMETHOD GetMigrateData(const PRUnichar* aProfile, bool aReplace,
- PRUint16* aResult);
+ uint16_t* aResult);
NS_IMETHOD GetSourceProfiles(nsIArray** aResult);
protected:
nsresult FillProfileDataFromSeamonkeyRegistry();
nsresult GetSourceProfile(const PRUnichar* aProfile);
nsresult CopyPreferences(bool aReplace);
nsresult TransformPreferences(const nsAString& aSourcePrefFileName,
--- a/mail/components/search/nsMailWinSearchHelper.cpp
+++ b/mail/components/search/nsMailWinSearchHelper.cpp
@@ -69,17 +69,17 @@ NS_IMETHODIMP nsMailWinSearchHelper::Get
return NS_ERROR_FAILURE;
nsRefPtr<ISearchCrawlScopeManager> crawlScopeManager;
hr = catalogManager->GetCrawlScopeManager(getter_AddRefs(crawlScopeManager));
if (FAILED(hr))
return NS_ERROR_FAILURE;
// We need to create appropriate URLs to check with the crawl scope manager.
- for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(sFoldersToIndex); i++)
+ for (uint32_t i = 0; i < NS_ARRAY_LENGTH(sFoldersToIndex); i++)
{
nsCOMPtr<nsIFile> subdir;
rv = mProfD->Clone(getter_AddRefs(subdir));
NS_ENSURE_SUCCESS(rv, rv);
nsDependentCString relativeStr(sFoldersToIndex[i]);
rv = subdir->AppendNative(relativeStr);
NS_ENSURE_SUCCESS(rv, rv);
--- a/mail/components/shell/nsMailGNOMEIntegration.cpp
+++ b/mail/components/shell/nsMailGNOMEIntegration.cpp
@@ -35,17 +35,17 @@ static const char* const sNewsProtocols[
"nntp"
};
static const char* const sFeedProtocols[] = {
"feed"
};
struct AppTypeAssociation {
- PRUint16 type;
+ uint16_t type;
const char * const *protocols;
const char *mimeType;
const char *extensions;
};
static const AppTypeAssociation sAppTypes[] = {
{ nsIShellService::MAIL, sMailProtocols, "message/rfc822", "eml" },
{ nsIShellService::NEWS, sNewsProtocols },
@@ -116,17 +116,17 @@ nsMailGNOMEIntegration::GetAppPathFromLa
mAppIsInPath = true;
}
g_free(tmp);
return true;
}
NS_IMETHODIMP
-nsMailGNOMEIntegration::IsDefaultClient(bool aStartupCheck, PRUint16 aApps, bool * aIsDefaultClient)
+nsMailGNOMEIntegration::IsDefaultClient(bool aStartupCheck, uint16_t aApps, bool * aIsDefaultClient)
{
*aIsDefaultClient = true;
for (unsigned int i = 0; i < NS_ARRAY_LENGTH(sAppTypes); i++) {
if (aApps & sAppTypes[i].type)
*aIsDefaultClient &= checkDefault(sAppTypes[i].protocols,
NS_ARRAY_LENGTH(sAppTypes[i].protocols));
}
@@ -135,17 +135,17 @@ nsMailGNOMEIntegration::IsDefaultClient(
// checked this session (so that subsequent window opens don't show the
// default client dialog).
if (aStartupCheck)
mCheckedThisSession = true;
return NS_OK;
}
NS_IMETHODIMP
-nsMailGNOMEIntegration::SetDefaultClient(bool aForAllUsers, PRUint16 aApps)
+nsMailGNOMEIntegration::SetDefaultClient(bool aForAllUsers, uint16_t aApps)
{
nsresult rv = NS_OK;
for (unsigned int i = 0; i < NS_ARRAY_LENGTH(sAppTypes); i++) {
if (aApps & sAppTypes[i].type) {
nsresult tmp = MakeDefault(sAppTypes[i].protocols,
NS_ARRAY_LENGTH(sAppTypes[i].protocols),
sAppTypes[i].mimeType,
sAppTypes[i].extensions);
--- a/mail/components/shell/nsMailMacIntegration.cpp
+++ b/mail/components/shell/nsMailMacIntegration.cpp
@@ -26,17 +26,17 @@ extern "C" {
}
NS_IMPL_ISUPPORTS1(nsMailMacIntegration, nsIShellService)
nsMailMacIntegration::nsMailMacIntegration(): mCheckedThisSession(false)
{}
NS_IMETHODIMP
-nsMailMacIntegration::IsDefaultClient(bool aStartupCheck, PRUint16 aApps, bool * aIsDefaultClient)
+nsMailMacIntegration::IsDefaultClient(bool aStartupCheck, uint16_t aApps, bool * aIsDefaultClient)
{
*aIsDefaultClient = true;
if (aApps & nsIShellService::MAIL)
*aIsDefaultClient &= isDefaultHandlerForProtocol(CFSTR("mailto"));
if (aApps & nsIShellService::NEWS)
*aIsDefaultClient &= isDefaultHandlerForProtocol(CFSTR("news"));
if (aApps & nsIShellService::RSS)
*aIsDefaultClient &= isDefaultHandlerForProtocol(CFSTR("feed"));
@@ -46,17 +46,17 @@ nsMailMacIntegration::IsDefaultClient(bo
// default client dialog.
if (aStartupCheck)
mCheckedThisSession = true;
return NS_OK;
}
NS_IMETHODIMP
-nsMailMacIntegration::SetDefaultClient(bool aForAllUsers, PRUint16 aApps)
+nsMailMacIntegration::SetDefaultClient(bool aForAllUsers, uint16_t aApps)
{
nsresult rv = NS_OK;
if (aApps & nsIShellService::MAIL)
rv |= setAsDefaultHandlerForProtocol(CFSTR("mailto"));
if (aApps & nsIShellService::NEWS)
rv |= setAsDefaultHandlerForProtocol(CFSTR("news"));
if (aApps & nsIShellService::RSS)
rv |= setAsDefaultHandlerForProtocol(CFSTR("feed"));
--- a/mail/components/shell/nsMailWinIntegration.cpp
+++ b/mail/components/shell/nsMailWinIntegration.cpp
@@ -249,17 +249,17 @@ nsresult nsWindowsShellService::Init()
}
nsWindowsShellService::nsWindowsShellService()
:mCheckedThisSession(false)
{
}
NS_IMETHODIMP
-nsWindowsShellService::IsDefaultClient(bool aStartupCheck, PRUint16 aApps, bool *aIsDefaultClient)
+nsWindowsShellService::IsDefaultClient(bool aStartupCheck, uint16_t aApps, bool *aIsDefaultClient)
{
// If this is the first mail window, maintain internal state that we've
// checked this session (so that subsequent window opens don't show the
// default client dialog).
if (aStartupCheck)
mCheckedThisSession = true;
*aIsDefaultClient = true;
@@ -286,17 +286,17 @@ nsWindowsShellService::IsDefaultClient(b
if (aApps & nsIShellService::RSS)
*aIsDefaultClient &= true;
// *aIsDefaultClient &= TestForDefault(gFeedSettings, sizeof(gFeedSettings)/sizeof(SETTING));
return NS_OK;
}
NS_IMETHODIMP
-nsWindowsShellService::SetDefaultClient(bool aForAllUsers, PRUint16 aApps)
+nsWindowsShellService::SetDefaultClient(bool aForAllUsers, uint16_t aApps)
{
nsAutoString appHelperPath;
if (NS_FAILED(GetHelperPath(appHelperPath)))
return NS_ERROR_FAILURE;
nsAutoString params;
if (aForAllUsers)
{
@@ -332,29 +332,29 @@ NS_IMETHODIMP
nsWindowsShellService::SetShouldCheckDefaultClient(bool aShouldCheck)
{
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
return prefs->SetBoolPref("mail.shell.checkDefaultClient", aShouldCheck);
}
/* helper routine. Iterate over the passed in settings object. */
bool
-nsWindowsShellService::TestForDefault(SETTING aSettings[], PRInt32 aSize)
+nsWindowsShellService::TestForDefault(SETTING aSettings[], int32_t aSize)
{
bool isDefault = true;
PRUnichar currValue[MAX_BUF];
SETTING* end = aSettings + aSize;
for (SETTING * settings = aSettings; settings < end; ++settings)
{
NS_ConvertUTF8toUTF16 dataLongPath(settings->valueData);
NS_ConvertUTF8toUTF16 key(settings->keyName);
NS_ConvertUTF8toUTF16 value(settings->valueName);
if (settings->flags & APP_PATH_SUBSTITUTION)
{
- PRInt32 offset = dataLongPath.Find("%APPPATH%");
+ int32_t offset = dataLongPath.Find("%APPPATH%");
dataLongPath.Replace(offset, 9, mAppLongPath);
}
::ZeroMemory(currValue, sizeof(currValue));
HKEY theKey;
nsresult rv = OpenKeyForReading(HKEY_CLASSES_ROOT, key, &theKey);
if (NS_FAILED(rv))
{
@@ -376,17 +376,17 @@ nsWindowsShellService::TestForDefault(SE
break;
}
} // for each registry key we want to look at
return isDefault;
}
bool
-nsWindowsShellService::IsDefaultClientVista(PRUint16 aApps, bool* aIsDefaultClient)
+nsWindowsShellService::IsDefaultClientVista(uint16_t aApps, bool* aIsDefaultClient)
{
IApplicationAssociationRegistration* pAAR;
HRESULT hr = CoCreateInstance (CLSID_ApplicationAssociationRegistration,
NULL,
CLSCTX_INPROC,
IID_IApplicationAssociationRegistration,
(void**)&pAAR);
--- a/mail/components/shell/nsMailWinIntegration.h
+++ b/mail/components/shell/nsMailWinIntegration.h
@@ -16,32 +16,32 @@
#define NS_MAILWININTEGRATION_CID \
{0x2ebbe84, 0xc179, 0x4598, {0xaf, 0x18, 0x1b, 0xf2, 0xc4, 0xbc, 0x1d, 0xf9}}
typedef struct {
char* keyName;
char* valueName;
char* valueData;
- PRInt32 flags;
+ int32_t flags;
} SETTING;
class nsWindowsShellService : public nsIWindowsShellService
{
public:
nsWindowsShellService();
virtual ~nsWindowsShellService() {};
NS_HIDDEN_(nsresult) Init();
NS_DECL_ISUPPORTS
NS_DECL_NSISHELLSERVICE
NS_DECL_NSIWINDOWSSHELLSERVICE
protected:
- bool TestForDefault(SETTING aSettings[], PRInt32 aSize);
- bool IsDefaultClientVista(PRUint16 aApps, bool* aIsDefaultClient);
+ bool TestForDefault(SETTING aSettings[], int32_t aSize);
+ bool IsDefaultClientVista(uint16_t aApps, bool* aIsDefaultClient);
private:
bool mCheckedThisSession;
nsAutoString mAppLongPath;
};
#endif
--- a/mailnews/addrbook/public/nsIAbLDAPReplicationData.idl
+++ b/mailnews/addrbook/public/nsIAbLDAPReplicationData.idl
@@ -15,17 +15,17 @@ interface nsIWebProgressListener;
* this service does replication of an LDAP directory to a local Mork AB Database.
*/
[scriptable, uuid(e628bbc9-8793-4f0b-bce4-990d399b1fca)]
interface nsIAbLDAPProcessReplicationData : nsISupports
{
/**
* readonly attribute giving the current replication state
*/
- readonly attribute PRInt32 replicationState;
+ readonly attribute int32_t replicationState;
/**
* replication states
*/
const long kIdle = 0;
const long kAnonymousBinding = 1;
const long kAuthenticatedBinding = 2;
const long kSyncServerBinding = 3;
@@ -36,17 +36,17 @@ interface nsIAbLDAPProcessReplicationDat
const long kSearchingRootDSE = 8;
const long kFindingChanges = 9;
const long kReplicatingChanges = 10;
const long kReplicationDone = 11;
/**
* readonly attribute giving the current protocol used
*/
- readonly attribute PRInt32 protocolUsed ;
+ readonly attribute int32_t protocolUsed ;
/**
* replication protocols
*/
const long kDefaultDownloadAll = 0;
const long kChangeLogProtocol = 1;
const long kLCUPProtocol = 2;
const long kLastUpdatedTimeStampMethod = 3;
--- a/mailnews/addrbook/public/nsIAbLDAPReplicationQuery.idl
+++ b/mailnews/addrbook/public/nsIAbLDAPReplicationQuery.idl
@@ -52,16 +52,16 @@ interface nsIAbLDAPChangeLogQuery : nsIS
/**
* Starts an LDAP query to search server's Root DSE
*/
void queryRootDSE();
/**
* Starts an LDAP ChangeLog query to find changelog entries
*/
- void queryChangeLog(in AUTF8String aChangeLogDN, in PRInt32 aLastChangeNo);
+ void queryChangeLog(in AUTF8String aChangeLogDN, in int32_t aLastChangeNo);
/**
* Starts an LDAP query to find changed entries
*/
void queryChangedEntries(in AUTF8String aChangedEntryDN);
};
--- a/mailnews/addrbook/public/nsIAddrDatabase.idl
+++ b/mailnews/addrbook/public/nsIAddrDatabase.idl
@@ -193,17 +193,17 @@ interface nsIAddrDatabase : nsIAddrDBAnn
*/
nsISimpleEnumerator getCardsFromAttribute(in nsIAbDirectory aDirectory,
in string aName,
in AUTF8String uUTF8Value,
in boolean aCaseInsensitive);
boolean findMailListbyUnicodeName(in wstring listName);
- void getCardCount(out PRUint32 count);
+ void getCardCount(out uint32_t count);
[noscript] readonly attribute nsIMdbRow newRow;
[noscript] readonly attribute nsIMdbRow newListRow;
[noscript] void addCardRowToDB(in nsIMdbRow newRow);
[noscript] void addLdifListMember(in nsIMdbRow row, in string value);
[noscript] void addFirstName(in nsIMdbRow row, in string value);
[noscript] void addLastName(in nsIMdbRow row, in string value);
[noscript] void addPhoneticFirstName(in nsIMdbRow row, in string value);
@@ -301,11 +301,11 @@ interface nsIAddrDatabase : nsIAddrDBAnn
void AddListCardColumnsToRow(in nsIAbCard aPCard,
in nsIMdbRow aPListRow,
in unsigned long aPos,
out nsIAbCard aPNewCard,
in boolean aInMailingList,
in nsIAbDirectory aParent,
in nsIAbDirectory aRoot);
void InitCardFromRow(in nsIAbCard aNewCard,in nsIMdbRow aCardRow);
- void SetListAddressTotal(in nsIMdbRow aListRow, in PRUint32 aTotal);
+ void SetListAddressTotal(in nsIMdbRow aListRow, in uint32_t aTotal);
nsIMdbRow FindRowByCard(in nsIAbCard aCard);
};
--- a/mailnews/addrbook/src/nsAbAddressCollector.cpp
+++ b/mailnews/addrbook/src/nsAbAddressCollector.cpp
@@ -78,42 +78,42 @@ nsAbAddressCollector::GetCardFromPropert
}
}
return nullptr;
}
NS_IMETHODIMP
nsAbAddressCollector::CollectAddress(const nsACString &aAddresses,
bool aCreateCard,
- PRUint32 aSendFormat)
+ uint32_t aSendFormat)
{
// If we've not got a valid directory, no point in going any further
if (!mDirectory)
return NS_OK;
// note that we're now setting the whole recipient list,
// not just the pretty name of the first recipient.
- PRUint32 numAddresses;
+ uint32_t numAddresses;
char *names;
char *addresses;
nsresult rv;
nsCOMPtr<nsIMsgHeaderParser> pHeader = do_GetService(NS_MAILNEWS_MIME_HEADER_PARSER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
rv = pHeader->ParseHeaderAddresses(PromiseFlatCString(aAddresses).get(),
&names, &addresses, &numAddresses);
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to parse, so can't collect");
if (NS_FAILED(rv))
return NS_OK;
char *curNamePtr = names;
char *curAddressPtr = addresses;
- for (PRUint32 i = 0; i < numAddresses; i++)
+ for (uint32_t i = 0; i < numAddresses; i++)
{
nsDependentCString curAddress(curAddressPtr);
curAddressPtr += curAddress.Length() + 1;
nsCString unquotedName;
rv = pHeader->UnquotePhraseOrAddr(curNamePtr, false,
getter_Copies(unquotedName));
curNamePtr += strlen(curNamePtr) + 1;
@@ -135,17 +135,17 @@ nsAbAddressCollector::CollectAddress(con
PR_FREEIF(names);
return NS_OK;
}
NS_IMETHODIMP
nsAbAddressCollector::CollectSingleAddress(const nsACString &aEmail,
const nsACString &aDisplayName,
bool aCreateCard,
- PRUint32 aSendFormat,
+ uint32_t aSendFormat,
bool aSkipCheckExisting)
{
if (!mDirectory)
return NS_OK;
nsresult rv;
nsCOMPtr<nsIAbCard> card;
bool emailAddressIn2ndEmailColumn = false;
@@ -203,17 +203,17 @@ nsAbAddressCollector::CollectSingleAddre
nsString displayName;
card->GetDisplayName(displayName);
// If we already have a display name, don't set the names on the card.
if (displayName.IsEmpty() && !aDisplayName.IsEmpty())
modifiedCard = SetNamesForCard(card, aDisplayName);
if (aSendFormat != nsIAbPreferMailFormat::unknown)
{
- PRUint32 currentFormat;
+ uint32_t currentFormat;
rv = card->GetPropertyAsUint32(kPreferMailFormatProperty,
¤tFormat);
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get preferred mail format");
// we only want to update the AB if the current format is unknown
if (currentFormat == nsIAbPreferMailFormat::unknown &&
NS_SUCCEEDED(card->SetPropertyAsUint32(kPreferMailFormatProperty,
aSendFormat)))
@@ -230,17 +230,17 @@ nsAbAddressCollector::CollectSingleAddre
// Works out the screen name to put on the card for some well-known addresses
void
nsAbAddressCollector::AutoCollectScreenName(nsIAbCard *aCard,
const nsACString &aEmail)
{
if (!aCard)
return;
- PRInt32 atPos = aEmail.FindChar('@');
+ int32_t atPos = aEmail.FindChar('@');
if (atPos == -1)
return;
const nsACString& domain = Substring(aEmail, atPos + 1);
if (domain.IsEmpty())
return;
// username in
--- a/mailnews/addrbook/src/nsAbBSDirectory.cpp
+++ b/mailnews/addrbook/src/nsAbBSDirectory.cpp
@@ -106,28 +106,28 @@ nsresult nsAbBSDirectory::EnsureInitiali
nsCOMPtr<nsIAbDirFactoryService> dirFactoryService =
do_GetService(NS_ABDIRFACTORYSERVICE_CONTRACTID,&rv);
NS_ENSURE_SUCCESS (rv, rv);
nsVoidArray *directories = DIR_GetDirectories();
if (!directories)
return NS_ERROR_FAILURE;
- PRInt32 count = directories->Count();
- for (PRInt32 i = 0; i < count; i++)
+ int32_t count = directories->Count();
+ for (int32_t i = 0; i < count; i++)
{
DIR_Server *server = (DIR_Server *)(directories->ElementAt(i));
// if this is a 4.x, local .na2 addressbook (PABDirectory)
// we must skip it.
// mozilla can't handle 4.x .na2 addressbooks
// note, the filename might be na2 for 4.x LDAP directories
// (we used the .na2 file for replication), and we don't want to skip
// those. see bug #127007
- PRUint32 fileNameLen = strlen(server->fileName);
+ uint32_t fileNameLen = strlen(server->fileName);
if (((fileNameLen > kABFileName_PreviousSuffixLen) &&
strcmp(server->fileName + fileNameLen - kABFileName_PreviousSuffixLen,
kABFileName_PreviousSuffix) == 0) &&
(server->dirType == PABDirectory))
continue;
// Set the uri property
nsCAutoString URI (server->uri);
@@ -159,17 +159,17 @@ nsresult nsAbBSDirectory::EnsureInitiali
mInitialized = true;
// sort directories by position...
return NS_OK;
}
NS_IMETHODIMP nsAbBSDirectory::CreateNewDirectory(const nsAString &aDirName,
const nsACString &aURI,
- PRUint32 aType,
+ uint32_t aType,
const nsACString &aPrefName,
nsACString &aResult)
{
nsresult rv = EnsureInitialized();
NS_ENSURE_SUCCESS(rv, rv);
/*
* TODO
@@ -266,21 +266,21 @@ NS_IMETHODIMP nsAbBSDirectory::DeleteDir
(void*)&getDirectories);
DIR_DeleteServerFromList(server);
nsCOMPtr<nsIAbDirFactoryService> dirFactoryService =
do_GetService(NS_ABDIRFACTORYSERVICE_CONTRACTID,&rv);
NS_ENSURE_SUCCESS (rv, rv);
- PRUint32 count = getDirectories.directories.Count();
+ uint32_t count = getDirectories.directories.Count();
nsCOMPtr<nsIAbManager> abManager = do_GetService(NS_ABMANAGER_CONTRACTID);
- for (PRUint32 i = 0; i < count; i++) {
+ for (uint32_t i = 0; i < count; i++) {
nsCOMPtr<nsIAbDirectory> d = getDirectories.directories[i];
mServers.Remove(d);
mSubDirectories.RemoveObject(d);
if (abManager)
abManager->NotifyDirectoryDeleted(this, d);
--- a/mailnews/addrbook/src/nsAbBSDirectory.h
+++ b/mailnews/addrbook/src/nsAbBSDirectory.h
@@ -20,17 +20,17 @@ public:
nsAbBSDirectory();
virtual ~nsAbBSDirectory();
// nsIAbDirectory methods
NS_IMETHOD Init(const char *aURI);
NS_IMETHOD GetChildNodes(nsISimpleEnumerator* *result);
NS_IMETHOD CreateNewDirectory(const nsAString &aDirName,
const nsACString &aURI,
- PRUint32 aType,
+ uint32_t aType,
const nsACString &aPrefName,
nsACString &aResult);
NS_IMETHOD CreateDirectoryByURI(const nsAString &aDisplayName,
const nsACString &aURI);
NS_IMETHOD DeleteDirectory(nsIAbDirectory *directory);
NS_IMETHOD HasDirectory(nsIAbDirectory *dir, bool *hasDir);
NS_IMETHOD UseForAutocomplete(const nsACString &aIdentityKey, bool *aResult);
NS_IMETHOD GetURI(nsACString &aURI);
--- a/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.cpp
+++ b/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.cpp
@@ -31,17 +31,17 @@ nsresult nsAbBoolExprToLDAPFilter::Filte
nsIAbBooleanExpression* expression,
nsCString& filter,
int flags)
{
nsCOMPtr<nsIArray> childExpressions;
nsresult rv = expression->GetExpressions(getter_AddRefs(childExpressions));
NS_ENSURE_SUCCESS(rv, rv);
- PRUint32 count;
+ uint32_t count;
rv = childExpressions->GetLength(&count);
NS_ENSURE_SUCCESS(rv, rv);
if (count == 0)
return NS_OK;
nsAbBooleanOperationType operation;
rv = expression->GetOperation(&operation);
@@ -99,23 +99,23 @@ nsresult nsAbBoolExprToLDAPFilter::Filte
}
nsresult nsAbBoolExprToLDAPFilter::FilterExpressions (
nsIAbLDAPAttributeMap *map,
nsIArray* expressions,
nsCString& filter,
int flags)
{
- PRUint32 count;
+ uint32_t count;
nsresult rv = expressions->GetLength(&count);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIAbBooleanConditionString> childCondition;
nsCOMPtr<nsIAbBooleanExpression> childExpression;
- for (PRUint32 i = 0; i < count; i++)
+ for (uint32_t i = 0; i < count; i++)
{
childCondition = do_QueryElementAt(expressions, i, &rv);
if (NS_SUCCEEDED(rv))
{
rv = FilterCondition (map, childCondition, filter, flags);
NS_ENSURE_SUCCESS(rv, rv);
continue;
}
--- a/mailnews/addrbook/src/nsAbCardProperty.cpp
+++ b/mailnews/addrbook/src/nsAbCardProperty.cpp
@@ -265,17 +265,17 @@ NS_IMETHODIMP nsAbCardProperty::GetPrope
NS_IMETHODIMP nsAbCardProperty::GetPropertyAsAUTF8String(const char *name, nsACString &value)
{
nsCOMPtr<nsIVariant> variant;
return m_properties.Get(nsDependentCString(name), getter_AddRefs(variant)) ?
variant->GetAsAUTF8String(value) : NS_ERROR_NOT_AVAILABLE;
}
-NS_IMETHODIMP nsAbCardProperty::GetPropertyAsUint32(const char *name, PRUint32 *value)
+NS_IMETHODIMP nsAbCardProperty::GetPropertyAsUint32(const char *name, uint32_t *value)
{
nsCOMPtr<nsIVariant> variant;
return m_properties.Get(nsDependentCString(name), getter_AddRefs(variant)) ?
variant->GetAsUint32(value) : NS_ERROR_NOT_AVAILABLE;
}
NS_IMETHODIMP nsAbCardProperty::GetPropertyAsBool(const char *name, bool *value)
{
@@ -301,17 +301,17 @@ NS_IMETHODIMP nsAbCardProperty::SetPrope
NS_IMETHODIMP nsAbCardProperty::SetPropertyAsAUTF8String(const char *name, const nsACString &value)
{
nsCOMPtr<nsIWritableVariant> variant = do_CreateInstance(NS_VARIANT_CONTRACTID);
variant->SetAsAUTF8String(value);
m_properties.Put(nsDependentCString(name), variant);
return NS_OK;
}
-NS_IMETHODIMP nsAbCardProperty::SetPropertyAsUint32(const char *name, PRUint32 value)
+NS_IMETHODIMP nsAbCardProperty::SetPropertyAsUint32(const char *name, uint32_t value)
{
nsCOMPtr<nsIWritableVariant> variant = do_CreateInstance(NS_VARIANT_CONTRACTID);
variant->SetAsUint32(value);
m_properties.Put(nsDependentCString(name), variant);
return NS_OK;
}
NS_IMETHODIMP nsAbCardProperty::SetPropertyAsBool(const char *name, bool value)
@@ -662,17 +662,17 @@ nsresult nsAbCardProperty::ConvertToEsca
}
rv = GetPropertyAsAString(kNotesProperty, str);
if (NS_SUCCEEDED(rv) && !str.IsEmpty())
{
myAddPropValue(vObj, VCNoteProp, str.get(), &vCardHasData);
}
- PRUint32 format;
+ uint32_t format;
rv = GetPropertyAsUint32(kPreferMailFormatProperty, &format);
if (NS_SUCCEEDED(rv) && format == nsIAbPreferMailFormat::html) {
myAddPropValue(vObj, VCUseHTML, NS_LITERAL_STRING("TRUE").get(), &vCardHasData);
}
else if (NS_SUCCEEDED(rv) && format == nsIAbPreferMailFormat::plaintext) {
myAddPropValue(vObj, VCUseHTML, NS_LITERAL_STRING("FALSE").get(), &vCardHasData);
}
@@ -740,17 +740,17 @@ nsresult nsAbCardProperty::ConvertToBase
}
nsresult nsAbCardProperty::ConvertToXMLPrintData(nsAString &aXMLSubstr)
{
nsresult rv;
nsCOMPtr<nsIPrefBranch> prefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
- PRInt32 generatedNameFormat;
+ int32_t generatedNameFormat;
rv = prefBranch->GetIntPref(PREF_MAIL_ADDR_BOOK_LASTNAMEFIRST, &generatedNameFormat);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIStringBundleService> stringBundleService =
mozilla::services::GetStringBundleService();
NS_ENSURE_TRUE(stringBundleService, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIStringBundle> bundle;
@@ -820,20 +820,20 @@ nsresult nsAbCardProperty::ConvertToXMLP
nsCOMPtr <nsIAbDirectory> mailList = nullptr;
rv = abManager->GetDirectory(m_MailListURI, getter_AddRefs(mailList));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIMutableArray> addresses;
rv = mailList->GetAddressLists(getter_AddRefs(addresses));
if (addresses) {
- PRUint32 total = 0;
+ uint32_t total = 0;
addresses->GetLength(&total);
if (total) {
- PRUint32 i;
+ uint32_t i;
nsAutoString displayName;
nsAutoString primaryEmail;
for (i = 0; i < total; i++) {
nsCOMPtr <nsIAbCard> listCard = do_QueryElementAt(addresses, i, &rv);
NS_ENSURE_SUCCESS(rv,rv);
xmlStr.AppendLiteral("<PrimaryEmail>\n");
@@ -871,29 +871,29 @@ nsresult nsAbCardProperty::ConvertToXMLP
xmlStr.AppendLiteral("</td></tr></table>");
aXMLSubstr = xmlStr;
return NS_OK;
}
-nsresult nsAbCardProperty::AppendSection(const AppendItem *aArray, PRInt16 aCount, const nsString& aHeading,
+nsresult nsAbCardProperty::AppendSection(const AppendItem *aArray, int16_t aCount, const nsString& aHeading,
nsIStringBundle *aBundle,
mozITXTToHTMLConv *aConv,
nsString &aResult)
{
nsresult rv = NS_OK;
aResult.AppendLiteral("<section>");
nsString attrValue;
bool sectionIsEmpty = true;
- PRInt16 i = 0;
+ int16_t i = 0;
for (i=0;i<aCount;i++) {
rv = GetPropertyAsAString(aArray[i].mColumn, attrValue);
if (NS_SUCCEEDED(rv) && !attrValue.IsEmpty())
sectionIsEmpty = false;
}
if (!sectionIsEmpty && !aHeading.IsEmpty()) {
nsString heading;
@@ -1054,17 +1054,17 @@ nsresult nsAbCardProperty::AppendCitySta
formattedString = zipResult;
}
aResult.Append(formattedString);
return NS_OK;
}
-NS_IMETHODIMP nsAbCardProperty::GenerateName(PRInt32 aGenerateFormat,
+NS_IMETHODIMP nsAbCardProperty::GenerateName(int32_t aGenerateFormat,
nsIStringBundle* aBundle,
nsAString &aResult)
{
aResult.Truncate();
// Cache the first and last names
nsAutoString firstName, lastName;
GetFirstName(firstName);
@@ -1123,17 +1123,17 @@ NS_IMETHODIMP nsAbCardProperty::Generate
if (aResult.IsEmpty())
{
// see bug #211078
// if there is no generated name at this point
// use the userid from the email address
// it is better than nothing.
GetPrimaryEmail(aResult);
- PRInt32 index = aResult.FindChar('@');
+ int32_t index = aResult.FindChar('@');
if (index != -1)
aResult.SetLength(index);
}
return NS_OK;
}
NS_IMETHODIMP nsAbCardProperty::GeneratePhoneticName(bool aLastNameFirst,
--- a/mailnews/addrbook/src/nsAbCardProperty.h
+++ b/mailnews/addrbook/src/nsAbCardProperty.h
@@ -41,17 +41,17 @@ protected:
bool m_IsMailList;
nsCString m_MailListURI;
// Store most of the properties here
nsInterfaceHashtable<nsCStringHashKey, nsIVariant> m_properties;
nsCString m_directoryId, m_localId;
private:
- nsresult AppendSection(const AppendItem *aArray, PRInt16 aCount, const nsString& aHeading, nsIStringBundle *aBundle, mozITXTToHTMLConv *aConv, nsString &aResult);
+ nsresult AppendSection(const AppendItem *aArray, int16_t aCount, const nsString& aHeading, nsIStringBundle *aBundle, mozITXTToHTMLConv *aConv, nsString &aResult);
nsresult AppendLine(const AppendItem &aItem, mozITXTToHTMLConv *aConv, nsString &aResult);
nsresult AppendLabel(const AppendItem &aItem, nsIStringBundle *aBundle, mozITXTToHTMLConv *aConv, nsString &aResult);
nsresult AppendCityStateZip(const AppendItem &aItem, nsIStringBundle *aBundle, mozITXTToHTMLConv *aConv, nsString &aResult);
nsresult ConvertToBase64EncodedXML(nsACString &result);
nsresult ConvertToXMLPrintData(nsAString &result);
nsresult ConvertToEscapedVCard(nsACString &result);
};
--- a/mailnews/addrbook/src/nsAbContentHandler.cpp
+++ b/mailnews/addrbook/src/nsAbContentHandler.cpp
@@ -125,30 +125,30 @@ nsAbContentHandler::HandleContent(const
return NS_ERROR_WONT_HANDLE_CONTENT;
return rv;
}
NS_IMETHODIMP
nsAbContentHandler::OnStreamComplete(nsIStreamLoader *aLoader,
nsISupports *aContext, nsresult aStatus,
- PRUint32 datalen, const PRUint8 *data)
+ uint32_t datalen, const uint8_t *data)
{
NS_ENSURE_ARG_POINTER(aContext);
NS_ENSURE_SUCCESS(aStatus, aStatus); // don't process the vcard if we got a status error
nsresult rv = NS_OK;
// take our vCard string and open up an address book window based on it
nsCOMPtr<nsIMsgVCardService> vCardService = do_GetService(NS_MSGVCARDSERVICE_CONTRACTID);
if (vCardService)
{
nsAutoPtr<VObject> vObj(vCardService->Parse_MIME((const char *)data, datalen));
if (vObj)
{
- PRInt32 len = 0;
+ int32_t len = 0;
nsCString vCard;
vCard.Adopt(vCardService->WriteMemoryVObjects(0, &len, vObj, false));
nsCOMPtr<nsIAbManager> ab =
do_GetService(NS_ABMANAGER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr <nsIAbCard> cardFromVCard;
--- a/mailnews/addrbook/src/nsAbDirProperty.cpp
+++ b/mailnews/addrbook/src/nsAbDirProperty.cpp
@@ -26,21 +26,21 @@ nsAbDirProperty::nsAbDirProperty(void)
}
nsAbDirProperty::~nsAbDirProperty(void)
{
#if 0
// this code causes a regression #138647
// don't turn it on until you figure it out
if (m_AddressList) {
- PRUint32 count;
+ uint32_t count;
nsresult rv;
rv = m_AddressList->GetLength(&count);
NS_ASSERTION(NS_SUCCEEDED(rv), "Count failed");
- PRInt32 i;
+ int32_t i;
for (i = count - 1; i >= 0; i--)
m_AddressList->RemoveElementAt(i);
}
#endif
}
NS_IMPL_ISUPPORTS4(nsAbDirProperty, nsIAbDirectory, nsISupportsWeakReference,
nsIAbCollection, nsIAbItem)
@@ -52,17 +52,17 @@ NS_IMETHODIMP nsAbDirProperty::GetUuid(n
NS_ENSURE_SUCCESS(rv, rv);
uuid.Append('&');
nsString dirName;
GetDirName(dirName);
uuid.Append(NS_ConvertUTF16toUTF8(dirName));
return rv;
}
-NS_IMETHODIMP nsAbDirProperty::GenerateName(PRInt32 aGenerateFormat,
+NS_IMETHODIMP nsAbDirProperty::GenerateName(int32_t aGenerateFormat,
nsIStringBundle *aBundle,
nsAString &name)
{
return GetDirName(name);
}
NS_IMETHODIMP nsAbDirProperty::GetPropertiesChromeURI(nsACString &aResult)
{
@@ -131,45 +131,45 @@ NS_IMETHODIMP nsAbDirProperty::SetDirNam
// We inherit from nsIAbDirectory, so this static cast should be safe.
abManager->NotifyItemPropertyChanged(static_cast<nsIAbDirectory*>(this),
"DirName", oldDirName.get(),
nsString(aDirName).get());
return NS_OK;
}
-NS_IMETHODIMP nsAbDirProperty::GetDirType(PRInt32 *aDirType)
+NS_IMETHODIMP nsAbDirProperty::GetDirType(int32_t *aDirType)
{
return GetIntValue("dirType", LDAPDirectory, aDirType);
}
NS_IMETHODIMP nsAbDirProperty::GetFileName(nsACString &aFileName)
{
return GetStringValue("filename", EmptyCString(), aFileName);
}
NS_IMETHODIMP nsAbDirProperty::GetURI(nsACString &aURI)
{
// XXX Should we complete this for Mailing Lists?
return NS_ERROR_NOT_IMPLEMENTED;
}
-NS_IMETHODIMP nsAbDirProperty::GetPosition(PRInt32 *aPosition)
+NS_IMETHODIMP nsAbDirProperty::GetPosition(int32_t *aPosition)
{
return GetIntValue("position", kDefaultPosition, aPosition);
}
-NS_IMETHODIMP nsAbDirProperty::GetLastModifiedDate(PRUint32 *aLastModifiedDate)
+NS_IMETHODIMP nsAbDirProperty::GetLastModifiedDate(uint32_t *aLastModifiedDate)
{
NS_ENSURE_ARG_POINTER(aLastModifiedDate);
*aLastModifiedDate = m_LastModifiedDate;
return NS_OK;
}
-NS_IMETHODIMP nsAbDirProperty::SetLastModifiedDate(PRUint32 aLastModifiedDate)
+NS_IMETHODIMP nsAbDirProperty::SetLastModifiedDate(uint32_t aLastModifiedDate)
{
if (aLastModifiedDate)
{
m_LastModifiedDate = aLastModifiedDate;
}
return NS_OK;
}
@@ -258,17 +258,17 @@ NS_IMETHODIMP nsAbDirProperty::GetIsQuer
NS_IMETHODIMP
nsAbDirProperty::Init(const char *aURI)
{
mURINoQuery = aURI;
mURI = aURI;
mIsValidURI = true;
- PRInt32 searchCharLocation = mURINoQuery.FindChar('?');
+ int32_t searchCharLocation = mURINoQuery.FindChar('?');
if (searchCharLocation >= 0)
{
mQueryString = Substring(mURINoQuery, searchCharLocation + 1);
mURINoQuery.SetLength(searchCharLocation);
mIsQueryURI = true;
}
return NS_OK;
@@ -293,17 +293,17 @@ nsAbDirProperty::HasCard(nsIAbCard *card
NS_IMETHODIMP
nsAbDirProperty::HasDirectory(nsIAbDirectory *dir, bool *hasDir)
{ return NS_ERROR_NOT_IMPLEMENTED; }
NS_IMETHODIMP
nsAbDirProperty::CreateNewDirectory(const nsAString &aDirName,
const nsACString &aURI,
- PRUint32 aType,
+ uint32_t aType,
const nsACString &aPrefName,
nsACString &aResult)
{ return NS_ERROR_NOT_IMPLEMENTED; }
NS_IMETHODIMP
nsAbDirProperty::CreateDirectoryByURI(const nsAString &aDisplayName,
const nsACString &aURI)
{ return NS_ERROR_NOT_IMPLEMENTED; }
@@ -418,18 +418,18 @@ nsresult nsAbDirProperty::InitDirectoryP
nsCString realPrefId(m_DirPrefId);
realPrefId.Append('.');
return prefService->GetBranch(realPrefId.get(), getter_AddRefs(m_DirectoryPrefs));
}
NS_IMETHODIMP nsAbDirProperty::GetIntValue(const char *aName,
- PRInt32 aDefaultValue,
- PRInt32 *aResult)
+ int32_t aDefaultValue,
+ int32_t *aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
if (!m_DirectoryPrefs && NS_FAILED(InitDirectoryPrefs()))
return NS_ERROR_NOT_INITIALIZED;
if (NS_FAILED(m_DirectoryPrefs->GetIntPref(aName, aResult)))
*aResult = aDefaultValue;
@@ -500,17 +500,17 @@ NS_IMETHODIMP nsAbDirProperty::GetLocali
aResult = aDefaultValue;
else
CopyUTF16toUTF8(wvalue, aResult);
return NS_OK;
}
NS_IMETHODIMP nsAbDirProperty::SetIntValue(const char *aName,
- PRInt32 aValue)
+ int32_t aValue)
{
if (!m_DirectoryPrefs && NS_FAILED(InitDirectoryPrefs()))
return NS_ERROR_NOT_INITIALIZED;
return m_DirectoryPrefs->SetIntPref(aName, aValue);
}
NS_IMETHODIMP nsAbDirProperty::SetBoolValue(const char *aName,
--- a/mailnews/addrbook/src/nsAbDirProperty.h
+++ b/mailnews/addrbook/src/nsAbDirProperty.h
@@ -39,17 +39,17 @@ public:
NS_DECL_NSIABDIRECTORY
protected:
/**
* Initialise the directory prefs for this branch
*/
nsresult InitDirectoryPrefs();
- PRUint32 m_LastModifiedDate;
+ uint32_t m_LastModifiedDate;
nsString m_ListDirName;
nsString m_ListName;
nsString m_ListNickName;
nsString m_Description;
bool m_IsMailList;
nsCString mURI;
--- a/mailnews/addrbook/src/nsAbDirectoryQuery.cpp
+++ b/mailnews/addrbook/src/nsAbDirectoryQuery.cpp
@@ -66,23 +66,23 @@ NS_IMETHODIMP nsAbDirectoryQuerySimpleBo
NS_IMETHODIMP nsAbDirectoryQuerySimpleBooleanExpression::SetExpressions(nsIArray *aExpressions)
{
if (!aExpressions)
return NS_ERROR_NULL_POINTER;
// Ensure all the items are of the right type.
nsresult rv;
- PRUint32 count;
+ uint32_t count;
rv = aExpressions->GetLength(&count);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIAbBooleanConditionString> queryExpression;
- for (PRUint32 i = 0; i < count; ++i)
+ for (uint32_t i = 0; i < count; ++i)
{
queryExpression = do_QueryElementAt(aExpressions, i, &rv);
if (NS_FAILED(rv))
return NS_ERROR_ILLEGAL_VALUE;
}
// Values ok, so we can just save and return.
mExpressions = aExpressions;
@@ -207,18 +207,18 @@ nsAbDirectoryQuery::nsAbDirectoryQuery()
nsAbDirectoryQuery::~nsAbDirectoryQuery()
{
}
NS_IMETHODIMP nsAbDirectoryQuery::DoQuery(nsIAbDirectory *aDirectory,
nsIAbDirectoryQueryArguments* arguments,
nsIAbDirSearchListener* listener,
- PRInt32 resultLimit, PRInt32 timeOut,
- PRInt32* _retval)
+ int32_t resultLimit, int32_t timeOut,
+ int32_t* _retval)
{
NS_ENSURE_ARG_POINTER(aDirectory);
nsCOMPtr<nsISupports> supportsExpression;
nsresult rv = arguments->GetExpression(getter_AddRefs(supportsExpression));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIAbBooleanExpression> expression(do_QueryInterface(supportsExpression, &rv));
@@ -232,27 +232,27 @@ NS_IMETHODIMP nsAbDirectoryQuery::DoQuer
rv = NS_FAILED(rv) ? queryError(listener) : queryFinished(listener);
*_retval = 0;
return rv;
}
/* void stopQuery (in long contextID); */
-NS_IMETHODIMP nsAbDirectoryQuery::StopQuery(PRInt32 contextID)
+NS_IMETHODIMP nsAbDirectoryQuery::StopQuery(int32_t contextID)
{
return NS_OK;
}
nsresult nsAbDirectoryQuery::query(nsIAbDirectory* directory,
nsIAbBooleanExpression* expression,
nsIAbDirSearchListener* listener,
bool doSubDirectories,
- PRInt32* resultLimit)
+ int32_t* resultLimit)
{
if (*resultLimit == 0)
return NS_OK;
nsresult rv = queryCards(directory, expression, listener, resultLimit);
NS_ENSURE_SUCCESS(rv, rv);
if (doSubDirectories && resultLimit != 0)
@@ -264,17 +264,17 @@ nsresult nsAbDirectoryQuery::query(nsIAb
return rv;
}
nsresult nsAbDirectoryQuery::queryChildren(nsIAbDirectory* directory,
nsIAbBooleanExpression* expression,
nsIAbDirSearchListener* listener,
bool doSubDirectories,
- PRInt32* resultLimit)
+ int32_t* resultLimit)
{
nsresult rv = NS_OK;
nsCOMPtr<nsISimpleEnumerator> subDirectories;
rv = directory->GetChildNodes(getter_AddRefs(subDirectories));
NS_ENSURE_SUCCESS(rv, rv);
bool hasMore;
@@ -292,17 +292,17 @@ nsresult nsAbDirectoryQuery::queryChildr
}
return NS_OK;
}
nsresult nsAbDirectoryQuery::queryCards(nsIAbDirectory* directory,
nsIAbBooleanExpression* expression,
nsIAbDirSearchListener* listener,
- PRInt32* resultLimit)
+ int32_t* resultLimit)
{
nsresult rv = NS_OK;
nsCOMPtr<nsISimpleEnumerator> cards;
rv = directory->GetChildCards(getter_AddRefs(cards));
if (NS_FAILED(rv))
{
if (rv != NS_ERROR_NOT_IMPLEMENTED)
@@ -332,17 +332,17 @@ nsresult nsAbDirectoryQuery::queryCards(
}
return NS_OK;
}
nsresult nsAbDirectoryQuery::matchCard(nsIAbCard* card,
nsIAbBooleanExpression* expression,
nsIAbDirSearchListener* listener,
- PRInt32* resultLimit)
+ int32_t* resultLimit)
{
bool matchFound = false;
nsresult rv = matchCardExpression(card, expression, &matchFound);
NS_ENSURE_SUCCESS(rv, rv);
if (matchFound)
{
(*resultLimit)--;
@@ -360,29 +360,29 @@ nsresult nsAbDirectoryQuery::matchCardEx
nsAbBooleanOperationType operation;
nsresult rv = expression->GetOperation (&operation);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIArray> childExpressions;
rv = expression->GetExpressions (getter_AddRefs (childExpressions));
NS_ENSURE_SUCCESS(rv, rv);
- PRUint32 count;
+ uint32_t count;
rv = childExpressions->GetLength(&count);
NS_ENSURE_SUCCESS(rv, rv);
if (operation == nsIAbBooleanOperationTypes::NOT &&
count > 1)
return NS_ERROR_FAILURE;
bool value = *result = false;
nsCOMPtr<nsIAbBooleanConditionString> childCondition;
nsCOMPtr<nsIAbBooleanExpression> childExpression;
- for (PRUint32 i = 0; i < count; i++)
+ for (uint32_t i = 0; i < count; i++)
{
childCondition = do_QueryElementAt(childExpressions, i, &rv);
if (NS_SUCCEEDED(rv))
{
rv = matchCardCondition (card, childCondition, &value);
NS_ENSURE_SUCCESS(rv, rv);
}
else
--- a/mailnews/addrbook/src/nsAbDirectoryQuery.h
+++ b/mailnews/addrbook/src/nsAbDirectoryQuery.h
@@ -73,30 +73,30 @@ public:
nsAbDirectoryQuery();
virtual ~nsAbDirectoryQuery();
protected:
nsresult query(nsIAbDirectory* directory,
nsIAbBooleanExpression* expression,
nsIAbDirSearchListener* listener,
bool doSubDirectories,
- PRInt32* resultLimit);
+ int32_t* resultLimit);
nsresult queryChildren(nsIAbDirectory* directory,
nsIAbBooleanExpression* expression,
nsIAbDirSearchListener* listener,
bool doSubDirectories,
- PRInt32* resultLimit);
+ int32_t* resultLimit);
nsresult queryCards(nsIAbDirectory* directory,
nsIAbBooleanExpression* expression,
nsIAbDirSearchListener* listener,
- PRInt32* resultLimit);
+ int32_t* resultLimit);
nsresult matchCard(nsIAbCard* card,
nsIAbBooleanExpression* expression,
nsIAbDirSearchListener* listener,
- PRInt32* resultLimit);
+ int32_t* resultLimit);
nsresult matchCardExpression(nsIAbCard* card,
nsIAbBooleanExpression* expression,
bool* result);
nsresult matchCardCondition(nsIAbCard* card,
nsIAbBooleanConditionString* condition,
bool* matchFound);
nsresult queryMatch (nsIAbCard* card,
--- a/mailnews/addrbook/src/nsAbLDAPAutoCompFormatter.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPAutoCompFormatter.cpp
@@ -121,21 +121,21 @@ nsAbLDAPAutoCompFormatter::Format(nsILDA
}
// all done; return the item
NS_IF_ADDREF(*aItem = item);
return NS_OK;
}
NS_IMETHODIMP
-nsAbLDAPAutoCompFormatter::FormatException(PRInt32 aState,
+nsAbLDAPAutoCompFormatter::FormatException(int32_t aState,
nsresult aErrorCode,
nsIAutoCompleteItem **aItem)
{
- PRInt32 errorKey;
+ int32_t errorKey;
nsresult rv;
// create an nsIAutoCompleteItem to hold the returned value
//
nsCOMPtr<nsIAutoCompleteItem> item = do_CreateInstance(
NS_AUTOCOMPLETEITEM_CONTRACTID, &rv);
if (NS_FAILED(rv)) {
@@ -218,18 +218,18 @@ nsAbLDAPAutoCompFormatter::FormatExcepti
// put the entire nsresult in string form
//
errCodeNum.AppendLiteral("0x");
errCodeNum.AppendInt(aErrorCode, 16);
// figure out the key to index into the string bundle
//
- const PRInt32 HOST_NOT_FOUND_ERROR=5000;
- const PRInt32 GENERIC_ERROR=9999;
+ const int32_t HOST_NOT_FOUND_ERROR=5000;
+ const int32_t GENERIC_ERROR=9999;
errorKey = ( (aErrorCode == NS_ERROR_UNKNOWN_HOST) ?
HOST_NOT_FOUND_ERROR : GENERIC_ERROR );
// get the specific error message itself
rv = ldapACBundle->GetStringFromID(errorKey,
getter_Copies(ldapErrMsg));
if (NS_FAILED(rv)) {
NS_ERROR("nsAbLDAPAutoCompleteFormatter::FormatException"
@@ -237,18 +237,18 @@ nsAbLDAPAutoCompFormatter::FormatExcepti
"from bundle "
LDAP_AUTOCOMPLETE_ERROR_BUNDLE);
return rv;
}
}
// and try to find a hint about what the user should do next
//
- const PRInt32 HINT_BASE=10000;
- const PRInt32 GENERIC_HINT_CODE = 9999;
+ const int32_t HINT_BASE=10000;
+ const int32_t GENERIC_HINT_CODE = 9999;
rv = ldapACBundle->GetStringFromID(HINT_BASE + errorKey,
getter_Copies(ldapHint));
if (NS_FAILED(rv)) {
rv = ldapACBundle->GetStringFromID(HINT_BASE + GENERIC_HINT_CODE,
getter_Copies(ldapHint));
if (NS_FAILED(rv)) {
NS_ERROR("nsAbLDAPAutoCompleteFormatter::FormatException()"
"(): error getting hint string from bundle "
@@ -541,17 +541,17 @@ nsAbLDAPAutoCompFormatter::AppendFirstAt
const nsACString &aAttrName, // attr to get
nsILDAPMessage *aMessage, // msg to get values from
bool aAttrRequired, // is this a required value?
nsACString &aValue)
{
// get the attribute values for the field which will be used
// to fill in nsIAutoCompleteItem::value
//
- PRUint32 numVals;
+ uint32_t numVals;
PRUnichar **values;
nsresult rv;
rv = aMessage->GetValues(nsCString(aAttrName).get(), &numVals,
&values);
if (NS_FAILED(rv)) {
switch (rv) {
--- a/mailnews/addrbook/src/nsAbLDAPCard.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPCard.cpp
@@ -46,35 +46,35 @@ NS_IMPL_ISUPPORTS_INHERITED1(nsAbLDAPCar
* the user instead of being discarded. There is one especially tricky case:
* when you do an update on a card which changes its DN, you have two
* operations (rename, then update the other attributes). If the rename
* operation succeeds and not the update of the attributes, you are
* "somewhere in between" the original card and the updated card.
*/
NS_IMETHODIMP nsAbLDAPCard::GetLDAPMessageInfo(
nsIAbLDAPAttributeMap *aAttributeMap,
- const PRUint32 aClassCount,
+ const uint32_t aClassCount,
const char **aClasses,
- PRInt32 aType,
+ int32_t aType,
nsIArray **aLDAPAddMessageInfo)
{
NS_ENSURE_ARG_POINTER(aAttributeMap);
NS_ENSURE_ARG_POINTER(aClasses);
NS_ENSURE_ARG_POINTER(aLDAPAddMessageInfo);
nsresult rv;
nsCOMPtr<nsIMutableArray> modArray =
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
// Add any missing object classes. We never remove any object
// classes: if an entry has additional object classes, it's probably
// for a good reason.
nsCAutoString oclass;
- for (PRUint32 i = 0; i < aClassCount; ++i)
+ for (uint32_t i = 0; i < aClassCount; ++i)
{
oclass.Assign(nsDependentCString(aClasses[i]));
ToLowerCase(oclass);
if (m_objectClass.IndexOf(oclass) == nsTArray<nsCString>::NoIndex)
{
m_objectClass.AppendElement(oclass);
printf("LDAP : adding objectClass %s\n", oclass.get());
@@ -84,17 +84,17 @@ NS_IMETHODIMP nsAbLDAPCard::GetLDAPMessa
nsCOMPtr<nsILDAPModification> mod =
do_CreateInstance("@mozilla.org/network/ldap-modification;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIMutableArray> values =
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
- for (PRUint32 i = 0; i < m_objectClass.Length(); ++i)
+ for (uint32_t i = 0; i < m_objectClass.Length(); ++i)
{
nsCOMPtr<nsILDAPBERValue> value =
do_CreateInstance("@mozilla.org/network/ldap-ber-value;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);
rv = value->SetFromUTF8(m_objectClass.ElementAt(i));
NS_ENSURE_SUCCESS(rv, rv);
@@ -110,17 +110,17 @@ NS_IMETHODIMP nsAbLDAPCard::GetLDAPMessa
// Add card properties
CharPtrArrayGuard props;
rv = aAttributeMap->GetAllCardProperties(props.GetSizeAddr(),
props.GetArrayAddr());
NS_ENSURE_SUCCESS(rv, rv);
nsCAutoString attr;
nsCString propvalue;
- for (PRUint32 i = 0; i < props.GetSize(); ++i)
+ for (uint32_t i = 0; i < props.GetSize(); ++i)
{
// Skip some attributes that don't map to LDAP.
//
// BirthYear : by default this is mapped to 'birthyear',
// which is not part of mozillaAbPersonAlpha
//
// LastModifiedDate : by default this is mapped to 'modifytimestamp',
// which cannot be modified
@@ -140,17 +140,17 @@ NS_IMETHODIMP nsAbLDAPCard::GetLDAPMessa
// If the property is not mapped to an attribute, skip it.
if (attr.IsEmpty())
continue;
nsCOMPtr<nsILDAPModification> mod =
do_CreateInstance("@mozilla.org/network/ldap-modification;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);
- PRUint32 index = m_attributes.IndexOf(attr);
+ uint32_t index = m_attributes.IndexOf(attr);
rv = GetPropertyAsAUTF8String(props[i], propvalue);
if (NS_SUCCEEDED(rv) &&!propvalue.IsEmpty())
{
// If the new value is not empty, add/update it
nsCOMPtr<nsILDAPBERValue> value =
do_CreateInstance("@mozilla.org/network/ldap-ber-value;1", &rv);
@@ -188,30 +188,30 @@ NS_IMETHODIMP nsAbLDAPCard::GetLDAPMessa
}
NS_ADDREF(*aLDAPAddMessageInfo = modArray);
return NS_OK;
}
NS_IMETHODIMP nsAbLDAPCard::BuildRdn(nsIAbLDAPAttributeMap *aAttributeMap,
- const PRUint32 aAttrCount,
+ const uint32_t aAttrCount,
const char **aAttributes,
nsACString &aRdn)
{
NS_ENSURE_ARG_POINTER(aAttributeMap);
NS_ENSURE_ARG_POINTER(aAttributes);
nsresult rv;
nsCString attr;
nsCAutoString prop;
nsCString propvalue;
aRdn.Truncate();
- for (PRUint32 i = 0; i < aAttrCount; ++i)
+ for (uint32_t i = 0; i < aAttrCount; ++i)
{
attr.Assign(nsDependentCString(aAttributes[i]));
// Lookup the property corresponding to the attribute
rv = aAttributeMap->GetProperty(attr, prop);
NS_ENSURE_SUCCESS(rv, rv);
// Get the property value
@@ -259,17 +259,17 @@ NS_IMETHODIMP nsAbLDAPCard::SetMetaPrope
// Get the list of set attributes
CharPtrArrayGuard attrs;
rv = aMessage->GetAttributes(attrs.GetSizeAddr(), attrs.GetArrayAddr());
NS_ENSURE_SUCCESS(rv, rv);
nsCAutoString attr;
m_attributes.Clear();
- for (PRUint32 i = 0; i < attrs.GetSize(); ++i)
+ for (uint32_t i = 0; i < attrs.GetSize(); ++i)
{
attr.Assign(nsDependentCString(attrs[i]));
ToLowerCase(attr);
m_attributes.AppendElement(attr);
}
// Get the objectClass values
m_objectClass.Clear();
@@ -281,17 +281,17 @@ NS_IMETHODIMP nsAbLDAPCard::SetMetaPrope
// nsILDAPMessage::GetValues returns NS_ERROR_LDAP_DECODING_ERROR if the
// requested attribute doesn't exist.
if (rv == NS_ERROR_LDAP_DECODING_ERROR)
return NS_OK;
NS_ENSURE_SUCCESS(rv, rv);
nsCAutoString oclass;
- for (PRUint32 i = 0; i < vals.GetSize(); ++i)
+ for (uint32_t i = 0; i < vals.GetSize(); ++i)
{
oclass.Assign(NS_LossyConvertUTF16toASCII(nsDependentString(vals[i])));
ToLowerCase(oclass);
m_objectClass.AppendElement(oclass);
}
return NS_OK;
}
--- a/mailnews/addrbook/src/nsAbLDAPChangeLogData.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPChangeLogData.cpp
@@ -61,17 +61,17 @@ NS_IMETHODIMP nsAbLDAPProcessChangeLogDa
}
nsresult nsAbLDAPProcessChangeLogData::OnLDAPBind(nsILDAPMessage *aMessage)
{
NS_ENSURE_ARG_POINTER(aMessage);
if(!mInitialized)
return NS_ERROR_NOT_INITIALIZED;
- PRInt32 errCode;
+ int32_t errCode;
nsresult rv = aMessage-&g