Changeset b00a2f2 in mainline


Ignore:
Timestamp:
2011-03-09T20:40:23Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8ceba1e
Parents:
bb0db564
Message:

Fix integers conversion functions

Location:
uspace/srv/fs/minixfs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/minixfs/mfs_utils.c

    rbb0db564 rb00a2f2  
    3131 */
    3232
     33#include <byteorder.h>
    3334#include "mfs_utils.h"
    3435
     
    3839                return n;
    3940
    40         return (n << 8) | (n >> 8);
     41        return uint16_t_byteorder_swap(n);
    4142}
    4243
     
    4647                return n;
    4748
    48         return conv16(native, n << 16) | conv16(native, n >> 16);
     49        return uint32_t_byteorder_swap(n);
     50}
     51
     52uint64_t conv64(bool native, uint64_t n)
     53{
     54        if (native)
     55                return n;
     56
     57        return uint64_t_byteorder_swap(n);
    4958}
    5059
  • uspace/srv/fs/minixfs/mfs_utils.h

    rbb0db564 rb00a2f2  
    3939uint16_t conv16(bool native, uint16_t n);
    4040uint32_t conv32(bool native, uint32_t n);
     41uint64_t conv64(bool native, uint64_t n);
    4142
    4243#endif
Note: See TracChangeset for help on using the changeset viewer.