possible solutions of the warning

Posted by lego69 on Stack Overflow See other posts from Stack Overflow or by lego69
Published on 2010-05-12T14:33:49Z Indexed on 2010/05/12 14:44 UTC
Read the original article Hit count: 133

Filed under:
|

Hello, I have a very large code, that's why I can't post here all my code, can somebody explain what might be a problem if I have an error incompatible pointer type and give me several ways to solve it, thanks in advance

just small clarification: I'm workin with pointers to functions

ptrLine createBasicLine(){
    DECLARE_RESULT_ALLOCATE_AND_CHECK(ptrLine, Line);
    result->callsHistory = listCreate(copyCall,destroyCall);          <-here
    result->messagesHistory = listCreate(copyMessage,destroyMessage); <-and here
    result->linesFeature = NULL;
    result->strNumber = NULL;
    result->lastBill = 0;
    result->lineType = MTM_REGULAR_LINE;
    result->nCallTime = 0;
    result->nMessages = 0;
    result->rateForCalls = 0;
    result->rateForMessage = 0;
    return result;
}

copyCall,destroyCall - pointers to functions

/**
 * Allocates a new List. The list starts empty.
 *
 * @param copyElement
 *  Function pointer to be used for copying elements into the list or when
 *  copying the list.
 * @param freeElement
 *  Function pointer to be used for removing elements from the list
 * @return
 *  NULL - if one of the parameters is NULL or allocations failed.
 *  A new List in case of success.
 */
List listCreate(CopyListElement copyElement, FreeListElement freeElement);

definitions of the functions

ptrCall (*createCall)() = createNumberContainer;

void (*destroyCall)(ptrCall) = destroyNumberContainer;

ptrCall (*copyCall)(ptrCall) = copyNumberContainer;

© Stack Overflow or respective owner

Related posts about c

    Related posts about eclipse