/[svn]/libgig/trunk/src/helper.h
ViewVC logotype

Diff of /libgig/trunk/src/helper.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 929 by schoenebeck, Tue Oct 24 22:24:45 2006 UTC revision 1179 by persson, Sat May 12 11:25:04 2007 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2   *                                                                         *   *                                                                         *
3   *   libgig - C++ cross-platform Gigasampler format file loader library    *   *   libgig - C++ cross-platform Gigasampler format file access library    *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003-2006 by Christian Schoenebeck                      *   *   Copyright (C) 2003-2006 by Christian Schoenebeck                      *
6   *                              <cuse@users.sourceforge.net>               *   *                              <cuse@users.sourceforge.net>               *
# Line 48  inline long Abs(long val) { Line 48  inline long Abs(long val) {
48  }  }
49    
50  /**  /**
51     * Stores a 16 bit integer in memory using little-endian format.
52     *
53     * @param pData - memory pointer
54     * @param data  - integer to be stored
55     */
56    inline void store16(uint8_t* pData, uint16_t data) {
57        pData[0] = data;
58        pData[1] = data >> 8;
59    }
60    
61    /**
62     * Stores a 32 bit integer in memory using little-endian format.
63     *
64     * @param pData - memory pointer
65     * @param data  - integer to be stored
66     */
67    inline void store32(uint8_t* pData, uint32_t data) {
68        pData[0] = data;
69        pData[1] = data >> 8;
70        pData[2] = data >> 16;
71        pData[3] = data >> 24;
72    }
73    
74    /**
75   * Swaps the order of the data words in the given memory area   * Swaps the order of the data words in the given memory area
76   * with a granularity given by \a WordSize.   * with a granularity given by \a WordSize.
77   *   *

Legend:
Removed from v.929  
changed lines
  Added in v.1179

  ViewVC Help
Powered by ViewVC