author | Matt Plumtree <matt.plumtree@nokia.com> |
Mon, 15 Nov 2010 09:56:25 +0000 | |
branch | bug235_bringup_0 |
changeset 77 | b0395290e61f |
parent 76 | 24381b61de5c |
permissions | -rw-r--r-- |
24 | 1 |
/* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
2 |
* |
|
3 |
* Permission is hereby granted, free of charge, to any person obtaining a |
|
4 |
* copy of this software and associated documentation files (the "Software"), |
|
5 |
* to deal in the Software without restriction, including without limitation |
|
6 |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
|
7 |
* and/or sell copies of the Software, and to permit persons to whom the |
|
8 |
* Software is furnished to do so, subject to the following conditions: |
|
9 |
* |
|
10 |
* The above copyright notice and this permission notice shall be included |
|
11 |
* in all copies or substantial portions of the Software. |
|
12 |
* |
|
13 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
|
14 |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
15 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
|
16 |
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
|
17 |
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
|
18 |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
19 |
* |
|
20 |
* Initial Contributors: |
|
21 |
* Nokia Corporation - initial contribution. |
|
22 |
* |
|
23 |
* Contributors: |
|
24 |
* |
|
25 |
* Description: |
|
26 |
* |
|
27 |
*/ |
|
28 |
||
29 |
#include "util.h" |
|
30 |
||
31 |
int dglLog2(unsigned int x) |
|
32 |
{ |
|
33 |
int r = 0; |
|
34 |
while(x >>= 1) |
|
35 |
{ |
|
36 |
r++; |
|
37 |
} |
|
38 |
return r; |
|
39 |
} |
|
40 |
||
41 |
int dglMin(int a, int b) |
|
42 |
{ |
|
43 |
return a < b ? a : b; |
|
44 |
} |
|
45 |
||
46 |
int dglMax(int a, int b) |
|
47 |
{ |
|
48 |
return a > b ? a : b; |
|
76
24381b61de5c
Host OpenGL ES 2.0 code now building without warning or error using GCC.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
55
diff
changeset
|
49 |
} |