Changeset 7bf29e5 in mainline for uspace/lib/c/include/align.h


Ignore:
Timestamp:
2025-01-09T11:29:38Z (5 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
a5c2960e
Parents:
bc3d695 (diff), 4e1221c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge 'upstream/master' into helenraid-para

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/align.h

    rbc3d695 r7bf29e5  
    4141 * @param a             Size of alignment, must be power of 2.
    4242 */
    43 #define ALIGN_DOWN(s, a)        ((s) & ~((a) - 1))
     43#define ALIGN_DOWN(s, a)        ((s) & ~((typeof(s))(a) - 1))
    4444
    4545/** Align to the nearest higher address which is a power of two.
     
    4848 * @param a             Size of alignment, must be power of 2.
    4949 */
    50 #define ALIGN_UP(s, a)          ((long)((s) + ((a) - 1)) & ~((long) (a) - 1))
     50#define ALIGN_UP(s, a)          ((((s) + ((a) - 1)) & ~((typeof(s))(a) - 1)))
    5151
    5252/** Round up to the nearest higher boundary.
Note: See TracChangeset for help on using the changeset viewer.