Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/lib/memfnc.c

    r2f7d77c6 ra35b458  
    8787}
    8888
    89 /** Compare two memory areas.
    90  *
    91  * @param s1  Pointer to the first area to compare.
    92  * @param s2  Pointer to the second area to compare.
    93  * @param len Size of the areas in bytes.
    94  *
    95  * @return Zero if areas have the same contents. If they differ,
    96  *         the sign of the result is the same as the sign of the
    97  *         difference of the first pair of different bytes.
    98  *
    99  */
    100 int memcmp(const void *s1, const void *s2, size_t len)
    101 {
    102         uint8_t *u1 = (uint8_t *) s1;
    103         uint8_t *u2 = (uint8_t *) s2;
    104         size_t i;
    105 
    106         for (i = 0; i < len; i++) {
    107                 if (*u1 != *u2)
    108                         return (int)(*u1) - (int)(*u2);
    109                 ++u1;
    110                 ++u2;
    111         }
    112 
    113         return 0;
    114 }
    115 
    11689/** @}
    11790 */
Note: See TracChangeset for help on using the changeset viewer.