author | William Roberts <williamr@symbian.org> |
Thu, 22 Jul 2010 16:47:01 +0100 | |
branch | GCC_SURGE |
changeset 49 | 5f20f71a57a3 |
parent 41 | ec40843d536a (diff) |
parent 45 | 15a2125aa2f3 (current diff) |
--- a/locationmgmt/locationcore/LbsClient/LbsApi/src/LbsPositionInfo.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationmgmt/locationcore/LbsClient/LbsApi/src/LbsPositionInfo.cpp Thu Jul 22 16:47:01 2010 +0100 @@ -116,12 +116,12 @@ EXPORT_C TPositionModeReason TPositionInfoBase::PositionModeReason() const /** @return Returns why the positioning mode used to calculate the position fix was different -from the prefered mode. For example, this could indicate that the phone is out of -network coverage. +from the prefered mode. For example, this could indicate that the phone is out of +network coverage. see PositionMode see _TPositionModeReason - + @return The method returns a bit mask the reasons why the position module was unable calculate the position in the prefered mode. @return EPositionModeReasonNone is returned if the mode used was the preferred. @@ -155,7 +155,7 @@ EXPORT_C void TPositionInfo::SetPosition(const TPosition& aPosition) /** -Sets the TPosition stored in this class +Sets the TPosition stored in this class @param aPosition The TPosition stored in this class is set to aPosition */ { @@ -188,7 +188,7 @@ EXPORT_C void TPositionCourseInfo::GetCourse(TCourse& aCourse) const /** -Gets the TCourse stored in this class +Gets the TCourse stored in this class @param aCourse The TCourse stored in this class is copied into aCourse. */ { @@ -197,7 +197,7 @@ EXPORT_C void TPositionCourseInfo::SetCourse(const TCourse& aCourse) /** -Sets the TCourse stored in this class +Sets the TCourse stored in this class @param aCourse The TCourse stored in this class is set to aCourse. */ { @@ -211,7 +211,7 @@ EXPORT_C HPositionGenericInfo* HPositionGenericInfo::NewLC(TInt aBufferSize, TInt aMaxFields) /** -Leaving constructor that allocs a HPositionGenericInfo on the heap and leaves a +Leaving constructor that allocs a HPositionGenericInfo on the heap and leaves a pointer to the object on the cleanup stack. @param aBufferSize Sets the size of the buffer that the HPositionGenericInfo will have. @param aMaxFields Sets the maximum number of fields that the HPositionGenericInfo will have. @@ -255,24 +255,24 @@ __ASSERT_ALWAYS(aMaxFields>0, User::Panic(KPosClientFault, EPositionGenericInfoZeroMaxFields)); TUint fieldIndexStartPos = aMaxFields*sizeof(TPositionFieldId); - if(_FOFF(HPositionGenericInfo, iBuffer[fieldIndexStartPos])&3) + if(_FOFF_DYNAMIC(HPositionGenericInfo, iBuffer[fieldIndexStartPos])&3) {//Adjust fieldIndexStartPos such that iBuffer[fieldIndexStartPos] is 4-byte aligned. - fieldIndexStartPos += 4 - (_FOFF(HPositionGenericInfo, iBuffer[fieldIndexStartPos])&3); + fieldIndexStartPos += 4 - (_FOFF_DYNAMIC(HPositionGenericInfo, iBuffer[fieldIndexStartPos])&3); } TUint dataStartPos = fieldIndexStartPos+aMaxFields*sizeof(TPositionFieldIndex); - + //iBuffer[0] must be 2 byte aligned since it is to be cast to a TPositionFieldId //array - __ASSERT_DEBUG(!(_FOFF(HPositionGenericInfo, iBuffer[0])&1), + __ASSERT_DEBUG(!(_FOFF(HPositionGenericInfo, iBuffer[0])&1), User::Panic(KPositionInternalFault, EBufferPosNotAligned)); - //Since fieldIndexStartPos will be 4-byte aligned into iBuffer, and + //Since fieldIndexStartPos will be 4-byte aligned into iBuffer, and //sizeof(TPositionFieldIndex)==8, dataStartPos should be 4-byte aligned. - __ASSERT_DEBUG(!(_FOFF(HPositionGenericInfo, iBuffer[dataStartPos])&3), + __ASSERT_DEBUG(!(_FOFF_DYNAMIC(HPositionGenericInfo, iBuffer[dataStartPos])&3), User::Panic(KPositionInternalFault, EBufferPosNotAligned)); - return new(User::Alloc(_FOFF(HPositionGenericInfo, iBuffer[aDataBufferSize+dataStartPos]))) + return new(User::Alloc(_FOFF_DYNAMIC(HPositionGenericInfo, iBuffer[aDataBufferSize+dataStartPos]))) HPositionGenericInfo(aDataBufferSize, aMaxFields, fieldIndexStartPos, dataStartPos, ETrue); } @@ -284,12 +284,12 @@ iDataStartPoint(aDataStartPoint), iTotalBufferSize(aDataBufferSize+aDataStartPoint) /** -private constructor. To be used within the class +private constructor. To be used within the class */ { - iPosClassSize = _FOFF(HPositionGenericInfo, iBuffer[iTotalBufferSize]); - iPosClassType |= EPositionGenericInfoClass; - + iPosClassSize = _FOFF_DYNAMIC(HPositionGenericInfo, iBuffer[iTotalBufferSize]); + iPosClassType |= EPositionGenericInfoClass; + if(aResetRequestedFields) { ClearRequestedFields(); @@ -375,7 +375,7 @@ EXPORT_C TInt HPositionGenericInfo::SetRequestedFields(const TPositionFieldIdList aFieldIdList) /** Sets multiple TPositionFieldId objects as requested. -@param aFieldIdList List of field Id's to be set as requested. The list is terminated +@param aFieldIdList List of field Id's to be set as requested. The list is terminated with a ::EPositionFieldNone entry. @return a symbian OS error code. @return KErrNone if all Field Ids were successfully set as requested. @@ -429,7 +429,7 @@ EXPORT_C TPositionFieldId HPositionGenericInfo::NextRequestedFieldId(TPositionFieldId aFieldId) const /** -Looks for the next field Id in the list greater than aFieldId. +Looks for the next field Id in the list greater than aFieldId. @param aFieldId Function will return next field Id in the list greater than this Id. @return Next field Id in the list greater than aFieldId. @return ::EPositionFieldNone if there are no field Id's in the list greater than aFieldId @@ -475,7 +475,7 @@ TInt HPositionGenericInfo::FindEmptyRequestedFieldOffset(TInt& aEmptyFieldOffset) const /** -Helper method. For internal usage only +Helper method. For internal usage only */ { TInt err = KErrOverflow;
--- a/locationmgmt/locationcore/LbsClient/LbsApi/src/lbsfields.cpp Wed Jun 23 19:48:34 2010 +0300 +++ b/locationmgmt/locationcore/LbsClient/LbsApi/src/lbsfields.cpp Thu Jul 22 16:47:01 2010 +0100 @@ -32,7 +32,7 @@ // End of fix for GCCE 4.x #define __DATA_OFFSET_INTO_HPOS(aOffset) \ - (_FOFF(HPositionGenericInfo, iBuffer[(aOffset+iInfo.iDataStartPoint)])) + (_FOFF_DYNAMIC(HPositionGenericInfo, iBuffer[(aOffset+iInfo.iDataStartPoint)])) const TInt KSizeOfTInt8 = sizeof(TInt8); const TInt KSizeOfTInt16 = sizeof(TInt16); @@ -50,7 +50,7 @@ * * @param aFieldIndex Field index for the object whos size we're interested in * - * @return The size of the field pointed at by aFieldIndex. The size is the number of 8-bit + * @return The size of the field pointed at by aFieldIndex. The size is the number of 8-bit * quantities occupied by the object. */ TInt TPositionFieldSetter::FieldLength(TInt aFieldIndexId) const @@ -84,13 +84,13 @@ { const TUint8* address = &(iInfo.iBuffer[fieldIndex.FieldStartPos()]); const TUint lengthOfString = reinterpret_cast<const SPackedTDesC16*>(address)->iLength; - return _FOFF(SPackedTDesC16, iBuf[lengthOfString]); + return _FOFF_DYNAMIC(SPackedTDesC16, iBuf[lengthOfString]); } case PositionFieldManager::ETDesC8: { const TUint8* address = &(iInfo.iBuffer[fieldIndex.FieldStartPos()]); const TUint lengthOfString = reinterpret_cast<const SPackedTDesC8*>(address)->iLength; - return _FOFF(SPackedTDesC8, iBuf[lengthOfString]); + return _FOFF_DYNAMIC(SPackedTDesC8, iBuf[lengthOfString]); } default: User::Panic(KPositionInternalFault, EUnknownDataType); @@ -100,7 +100,7 @@ /** * This function rounds up aOffset so that HPositionGenericInfo::iBuffer[aOffset] will - * be suitable aligned for data of aFieldType, such that the copy operator for this + * be suitable aligned for data of aFieldType, such that the copy operator for this * data type will be able to be used at &HPositionGenericInfo::iBuffer[aOffset]. * * @param aOffset Offset to be rounded up for alignment reasons. @@ -142,16 +142,16 @@ * the buffer as the contents of the buffer can only be accessed via the index anyway. * Then we find a empty slot in the index. This will be the first field in the index marked * with the field type PositionFieldManager::EUndefined. Then we look at where the previous - * field ended and pretend we're going to stick this new field onto the end of that. If it - * fits then we do the copy. If it doesn't fit then we try compressing the contents of the + * field ended and pretend we're going to stick this new field onto the end of that. If it + * fits then we do the copy. If it doesn't fit then we try compressing the contents of the * buffer and seeing if we can get the field to fit then. If we still can't get it to fit * we return an error. Otherwise we copy the data into the buffer. * * @param aFieldId Id of the field to be copied into the buffer. - * @param aData a wrapper round the object to be copied into the buffer. It contains + * @param aData a wrapper round the object to be copied into the buffer. It contains * information about the data type/size and a pointer to a copy method. * @return KErrNone if the operation was successful. - * @return KErrPositionBufferOverflow if aData will not fit in the HPositionGenericInfo + * @return KErrPositionBufferOverflow if aData will not fit in the HPositionGenericInfo * object's buffer. * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the * HPositionGenericInfo object. @@ -175,7 +175,7 @@ { return err; } - + TInt offsetOfNewData; TPositionFieldIndex* const fieldIndex = iInfo.FieldIndexPtr(); @@ -192,7 +192,7 @@ } AlignOffset(offsetOfNewData, aData.Type()); - + TBool enoughSpace = EFalse; if(offsetOfNewData+aData.Size() <= iInfo.iTotalBufferSize) //bounds check { @@ -210,7 +210,7 @@ + FieldLength(indexToInsertAt-1); AlignOffset(offsetOfNewData, aData.Type()); - + if(offsetOfNewData+aData.Size() <= iInfo.iTotalBufferSize) //bounds check { enoughSpace = ETrue; @@ -251,7 +251,7 @@ * @return KErrNone is the operation was successful. * @return KErrNotFound if an object with aFieldId cannot be found in aInfo. * @return KErrArgument if aFieldId is EPositionFieldNone. - * @panic "LocationClient EHPositionGenericInfoMismatchDataType(0)" if aFieldId's data type + * @panic "LocationClient EHPositionGenericInfoMismatchDataType(0)" if aFieldId's data type * doesn't match that pointed at by aData. */ TInt TPositionFieldGetter::DoGetValue(TPositionFieldId aFieldId, @@ -425,7 +425,7 @@ * @param aInfo The HPositionGenericInfo object to copy the data into. * * @return KErrArgument if aFieldId is EPositionFieldNone. - * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo + * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo * object. * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the * HPositionGenericInfo object. @@ -467,7 +467,7 @@ * @param aInfo The HPositionGenericInfo object to copy the data into. * * @return KErrArgument if aFieldId is EPositionFieldNone. - * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo + * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo * object. * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the * HPositionGenericInfo object. @@ -509,7 +509,7 @@ * @param aInfo The HPositionGenericInfo object to copy the data into. * * @return KErrArgument if aFieldId is EPositionFieldNone. - * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo + * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo * object. * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the * HPositionGenericInfo object. @@ -551,7 +551,7 @@ * @param aInfo The HPositionGenericInfo object to copy the data into. * * @return KErrArgument if aFieldId is EPositionFieldNone. - * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo + * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo * object. * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the * HPositionGenericInfo object. @@ -595,7 +595,7 @@ * @param aInfo The HPositionGenericInfo object to copy the data into. * * @return KErrArgument if aFieldId is EPositionFieldNone. - * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo + * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo * object. * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the * HPositionGenericInfo object. @@ -639,7 +639,7 @@ * @param aInfo The HPositionGenericInfo object to copy the data into. * * @return KErrArgument if aFieldId is EPositionFieldNone. - * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo + * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo * object. * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the * HPositionGenericInfo object. @@ -683,7 +683,7 @@ * @param aInfo The HPositionGenericInfo object to copy the data into. * * @return KErrArgument if aFieldId is EPositionFieldNone. - * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo + * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo * object. * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the * HPositionGenericInfo object. @@ -727,7 +727,7 @@ * @param aInfo The HPositionGenericInfo object to copy the data into. * * @return KErrArgument if aFieldId is EPositionFieldNone. - * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo + * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo * object. * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the * HPositionGenericInfo object. @@ -771,7 +771,7 @@ * @param aInfo The HPositionGenericInfo object to copy the data into. * * @return KErrArgument if aFieldId is EPositionFieldNone. - * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo + * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo * object. * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the * HPositionGenericInfo object. @@ -816,7 +816,7 @@ * @param aInfo The HPositionGenericInfo object to copy the data into. * * @return KErrArgument if aFieldId is EPositionFieldNone. - * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo + * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo * object. * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the * HPositionGenericInfo object. @@ -825,8 +825,8 @@ EXPORT_C TInt PositionFieldManager::SetValue(TPositionFieldId aFieldId, const TDesC8& aValue, HPositionGenericInfo& aInfo) - { - const TDataWrapperC wrapper(ETDesC8, _FOFF(SPackedTDesC8, iBuf[aValue.Length()]), &aValue, CopyFromTDesC8); + { + const TDataWrapperC wrapper(ETDesC8, _FOFF_DYNAMIC(SPackedTDesC8, iBuf[aValue.Length()]), &aValue, CopyFromTDesC8); TPositionFieldSetter fieldSetter(aInfo); return fieldSetter.DoSetValue(aFieldId, wrapper); } @@ -859,7 +859,7 @@ * @param aInfo The HPositionGenericInfo object to copy the data into. * * @return KErrArgument if aFieldId is EPositionFieldNone. - * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo + * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo * object. * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the * HPositionGenericInfo object. @@ -869,7 +869,7 @@ const TDesC16& aValue, HPositionGenericInfo& aInfo) { - const TDataWrapperC wrapper(ETDesC16, (_FOFF(SPackedTDesC16, iBuf[aValue.Length()])), &aValue, CopyFromTDesC16); + const TDataWrapperC wrapper(ETDesC16, _FOFF_DYNAMIC(SPackedTDesC16, iBuf[aValue.Length()]), &aValue, CopyFromTDesC16); TPositionFieldSetter fieldSetter(aInfo); return fieldSetter.DoSetValue(aFieldId, wrapper); } @@ -940,7 +940,7 @@ * @param aInfo The HPositionGenericInfo object to copy the data into. * * @return KErrArgument if aFieldId is EPositionFieldNone. - * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo + * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo * object. * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the * HPositionGenericInfo object. @@ -984,7 +984,7 @@ * @param aInfo The HPositionGenericInfo object to copy the data into. * * @return KErrArgument if aFieldId is EPositionFieldNone. - * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo + * @return KErrPositionBufferOverflow if aValue will not fit in the HPositionGenericInfo * object. * @return KErrOverflow if there are already KPositionMaxReturnableFields set in the * HPositionGenericInfo object.