Changeset 392bd67c in mainline


Ignore:
Timestamp:
2012-02-25T13:44:27Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
da34d61d
Parents:
ba55c194
Message:

mkexfat: add function that computes the checksum value of the upcase table.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/mkexfat/mkexfat.c

    rba55c194 r392bd67c  
    569569}
    570570
     571/** Compute the checksum of the upcase table.
     572 *
     573 * @param data   Pointer to the upcase table.
     574 * @param nbytes size of the upcase table in bytes.
     575 * @return   Checksum value.
     576 */
     577static uint32_t
     578upcase_table_checksum(void const *data, size_t nbytes)
     579{
     580        size_t index;
     581        uint32_t chksum = 0;
     582        uint8_t const *octets = (uint8_t *) data;
     583
     584        for (index = 0; index < nbytes; ++index)
     585                chksum = ((chksum << 31) | (chksum >> 1)) + octets[index];
     586
     587        return chksum;
     588}
     589
    571590int main (int argc, char **argv)
    572591{
Note: See TracChangeset for help on using the changeset viewer.