Andrew Geissler | 9d3cc05 | 2021-03-31 13:36:22 -0500 | [diff] [blame] | 1 | Fix error when compile for powerpc: |
| 2 | |
| 3 | | x_sh_dbIO.c: In function 'swap_short': |
| 4 | | x_sh_dbIO.c:229:36: error: initializer element is not constant |
| 5 | | 229 | static unsigned short ooop = *iptr; |
| 6 | | | ^ |
| 7 | |
| 8 | Upstream-Status: Pending |
| 9 | |
| 10 | Signed-off-by: Kai Kang <kai.kang@windriver.com> |
| 11 | --- |
| 12 | src/sh_dbIO.c | 3 ++- |
| 13 | 1 file changed, 2 insertions(+), 1 deletion(-) |
| 14 | |
| 15 | diff --git a/src/sh_dbIO.c b/src/sh_dbIO.c |
| 16 | index b547ac5..23a9621 100644 |
| 17 | --- a/src/sh_dbIO.c |
| 18 | +++ b/src/sh_dbIO.c |
| 19 | @@ -226,7 +226,8 @@ static unsigned short * swap_short (unsigned short * iptr) |
| 20 | else |
| 21 | { |
| 22 | /* alignment problem */ |
| 23 | - static unsigned short ooop = *iptr; |
| 24 | + static unsigned short ooop; |
| 25 | + ooop = *iptr; |
| 26 | unsigned short hi = (ooop & 0xff00); |
| 27 | unsigned short lo = (ooop & 0xff); |
| 28 | ooop = (lo << 8) | (hi >> 8); |