mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-12 10:00:17 +01:00
This was re-implemented in several places, so lets share it. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28720>
25 lines
425 B
C
25 lines
425 B
C
/*
|
|
* Copyright 2024 Intel Corporation
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#include "error_decode_lib.h"
|
|
|
|
const char *
|
|
ascii85_decode_char(const char *in, uint32_t *v)
|
|
{
|
|
*v = 0;
|
|
|
|
if (*in == 'z') {
|
|
in++;
|
|
} else {
|
|
*v += in[0] - 33; *v *= 85;
|
|
*v += in[1] - 33; *v *= 85;
|
|
*v += in[2] - 33; *v *= 85;
|
|
*v += in[3] - 33; *v *= 85;
|
|
*v += in[4] - 33;
|
|
in += 5;
|
|
}
|
|
|
|
return in;
|
|
}
|