1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: cx_Utility.cpp 4 5 Copyright (C)2009-2012 Nintendo Co., Ltd. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Rev: 47707 $ 14 *---------------------------------------------------------------------------*/ 15 16 #include <nn/cx.h> 17 #include "cx_Utility.h" 18 #include <zlib.h> 19 20 namespace nn { 21 namespace cx { 22 namespace detail { 23 24 ConvertZlibReturnCode(int zlibReturnCode)25 s32 ConvertZlibReturnCode(int zlibReturnCode) 26 { 27 switch( zlibReturnCode ) 28 { 29 case Z_OK: return ERROR_CODE_SUCCESS; 30 case Z_STREAM_END: return ERROR_CODE_SUCCESS; 31 case Z_NEED_DICT: return ERROR_CODE_UNSUPPORTED; 32 case Z_ERRNO: return ERROR_CODE_UNSUPPORTED; 33 case Z_STREAM_ERROR: return ERROR_CODE_BUFFER_OVERRUN; 34 case Z_DATA_ERROR: return ERROR_CODE_UNSUPPORTED; 35 case Z_MEM_ERROR: return ERROR_CODE_BUFFER_OVERRUN; 36 case Z_BUF_ERROR: return ERROR_CODE_DATA_SHORTAGE; 37 case Z_VERSION_ERROR: return ERROR_CODE_UNSUPPORTED; 38 } 39 return ERROR_CODE_UNSUPPORTED; 40 } 41 42 43 44 }}} 45