Actual source code: bgl_align.c

  1: /*     =================================
  2:     Test arrays BGL alignment on 16bit boundary memory

  4:     Date: 06/23/05
  5:     Authors:  Pascal Vezolle/Yannick Langlois 
  6:       ================================= */

  8: int align1(int x) {
  9:    if ( (x & 0xf) == 0 ) return 0;
 10:    return -1;
 11: }
 12: int align2(int x, int x1) {
 13:    if ( ((x | x1) & 0xf) == 0 ) return 0;
 14:    return -1;
 15: }
 16: int align3(int x, int x1, int x2) {
 17:    if ( (((x | x1) | x2) & 0xf) == 0 ) return 0;
 18:    return -1;
 19: }
 20: int align4(int x, int x1, int x2, int x3) {
 21:    if ( ((((x | x1) | x2) | x3) & 0xf) == 0 ) return 0;
 22:    return -1;
 23: }
 24: int align5(int x, int x1, int x2, int x3, int x4) {
 25:    if ( (((((x | x1) | x2) | x3) | x4) & 0xf) == 0 ) return 0;
 26:    return -1;
 27: }
 28: int align6(int x, int x1, int x2, int x3, int x4, int x5) {
 29:    if ( ((((((x | x1) | x2) | x3) | x4) | x5) & 0xf) == 0 ) return 0;
 30:    return -1;
 31: }
 32: int align7(int x, int x1, int x2, int x3, int x4, int x5, int x6) {
 33:    if ( (((((((x | x1) | x2) | x3) | x4) | x5) | x6) & 0xf) == 0 ) return 0;
 34:    return -1;
 35: }