This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

warning correction help

openPOWERLINK_v1.1.0\EplStack\EplApiGeneric.c(1648): warning:  #68-D: integer conversion resulted in a change of sign

The parameter is usually assigned a dword value, but when, on initiation of the code, it is assigned a -1, the program should assign the parameter with a default value which is stored in an object dictionary.

if (EplApiInstance_g.m_InitParam.m_dwCycleLen != -1)

m_dwCycleLen is a DWORD. How can I remove the warning?

Parents
  • "ULONG32BITLOWENDIAN".

    Note that the processor should normally not have any data type specifing big or little endian. Most processors can't even read variables of "wrong" byte order and require that you write code to read the value byte-by-byte and glue the data together again.

    You write your program to always use the native format for the internal variables - in which case you don't need to know what that format is.

    Only when storing binary data to disk, transmitting etc do you need to care about the byte order. Then you normally write a function to convert to/from little-endian or big-endian, depending on what format the file format or link protocol is defined to use.

    Some file formats or protocols are defined to work with either byte order, by containing a magic marker to let the other side auto-detect the used byte order.

Reply
  • "ULONG32BITLOWENDIAN".

    Note that the processor should normally not have any data type specifing big or little endian. Most processors can't even read variables of "wrong" byte order and require that you write code to read the value byte-by-byte and glue the data together again.

    You write your program to always use the native format for the internal variables - in which case you don't need to know what that format is.

    Only when storing binary data to disk, transmitting etc do you need to care about the byte order. Then you normally write a function to convert to/from little-endian or big-endian, depending on what format the file format or link protocol is defined to use.

    Some file formats or protocols are defined to work with either byte order, by containing a magic marker to let the other side auto-detect the used byte order.

Children