Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b302bd5d authored by Ashok Bhat's avatar Ashok Bhat
Browse files

LP64 fixes for media/libeffects



Changes include:

[x] In get parameter series of functions, replaced size_t*
    formal parameter type with uint32_t* where actual parameter
    passed was uint32_t*.

[x] In set parameter series of functions, changed size_t
    formal parameter to uint32_t where actual parameter was
    uint32_t.

[x] Changed the definition of LVM_UINT32 from unsigned
    long to uint32_t as unsigned long is 64-bit in LP64.

[x] Used other stdint.h types for other LVM_types for
    consistency.

[x] Use of uintptr_t for the pNextMember of the INST_ALLOC
    structure, rather than LVM_UINT32, for portablility.

[x] Use of uintptr_t where pointers are used in arithmetic.

[x] Replaced the use of 0xFFFFFFFC with ~3 in places where
    it was used to clear last two bits.

[x] Removed int casts where cmdSize and *replySize, both
    uint32_t, were being compared with sizeof().

Change-Id: Ibec0b4d8e9b855f44b1cd853be6df84d13cf4186
Signed-off-by: default avatarMarcus Oakland <marcus.oakland@arm.com>
Signed-off-by: default avatarAshok Bhat <ashok.bhat@arm.com>
parent 80b72e6f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -697,7 +697,7 @@ int Downmix_Reset(downmix_object_t *pDownmixer, bool init) {
 *
 *----------------------------------------------------------------------------
 */
int Downmix_setParameter(downmix_object_t *pDownmixer, int32_t param, size_t size, void *pValue) {
int Downmix_setParameter(downmix_object_t *pDownmixer, int32_t param, uint32_t size, void *pValue) {

    int16_t value16;
    ALOGV("Downmix_setParameter, context %p, param %d, value16 %d, value32 %d",
@@ -707,7 +707,7 @@ int Downmix_setParameter(downmix_object_t *pDownmixer, int32_t param, size_t siz

      case DOWNMIX_PARAM_TYPE:
        if (size != sizeof(downmix_type_t)) {
            ALOGE("Downmix_setParameter(DOWNMIX_PARAM_TYPE) invalid size %zu, should be %zu",
            ALOGE("Downmix_setParameter(DOWNMIX_PARAM_TYPE) invalid size %u, should be %zu",
                    size, sizeof(downmix_type_t));
            return -EINVAL;
        }
@@ -753,7 +753,7 @@ int Downmix_setParameter(downmix_object_t *pDownmixer, int32_t param, size_t siz
 *
 *----------------------------------------------------------------------------
 */
int Downmix_getParameter(downmix_object_t *pDownmixer, int32_t param, size_t *pSize, void *pValue) {
int Downmix_getParameter(downmix_object_t *pDownmixer, int32_t param, uint32_t *pSize, void *pValue) {
    int16_t *pValue16;

    switch (param) {
+2 −2
Original line number Diff line number Diff line
@@ -93,8 +93,8 @@ static int Downmix_GetDescriptor(effect_handle_t self,
int Downmix_Init(downmix_module_t *pDwmModule);
int Downmix_Configure(downmix_module_t *pDwmModule, effect_config_t *pConfig, bool init);
int Downmix_Reset(downmix_object_t *pDownmixer, bool init);
int Downmix_setParameter(downmix_object_t *pDownmixer, int32_t param, size_t size, void *pValue);
int Downmix_getParameter(downmix_object_t *pDownmixer, int32_t param, size_t *pSize, void *pValue);
int Downmix_setParameter(downmix_object_t *pDownmixer, int32_t param, uint32_t size, void *pValue);
int Downmix_getParameter(downmix_object_t *pDownmixer, int32_t param, uint32_t *pSize, void *pValue);

void Downmix_foldFromQuad(int16_t *pSrc, int16_t*pDst, size_t numFrames, bool accumulate);
void Downmix_foldFromSurround(int16_t *pSrc, int16_t*pDst, size_t numFrames, bool accumulate);
+1 −1
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@ LVDBE_ReturnStatus_en LVDBE_Init(LVDBE_Handle_t *phInstance,
            {
                return(LVDBE_NULLADDRESS);
            }
            if (((LVM_UINT32)pMemoryTable->Region[i].pBaseAddress % pMemoryTable->Region[i].Alignment)!=0){
            if (((uintptr_t)pMemoryTable->Region[i].pBaseAddress % pMemoryTable->Region[i].Alignment)!=0){
                return(LVDBE_ALIGNMENTERROR);
            }
        }
+1 −1
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ LVM_ReturnStatus_en LVM_Process(LVM_Handle_t hInstance,
        /*
         * Check the buffer alignment
         */
        if((((LVM_UINT32)pInData % 4) != 0) || (((LVM_UINT32)pOutData % 4) != 0))
        if((((uintptr_t)pInData % 4) != 0) || (((uintptr_t)pOutData % 4) != 0))
        {
            return(LVM_ALIGNMENTERROR);
        }
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ extern "C" {
typedef struct
{
    LVM_UINT32              TotalSize;      /*  Accumulative total memory size                      */
    LVM_UINT32              pNextMember;    /*  Pointer to the next instance member to be allocated */
    uintptr_t               pNextMember;    /*  Pointer to the next instance member to be allocated */
}   INST_ALLOC;


Loading