Skip to content

Instantly share code, notes, and snippets.

@mrpossoms
Created February 14, 2019 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrpossoms/97971f8695a07f5ac8417264be983aa3 to your computer and use it in GitHub Desktop.
Save mrpossoms/97971f8695a07f5ac8417264be983aa3 to your computer and use it in GitHub Desktop.
Lunacy
#define RESULT_TO_STRING( r ) \
( ( r ) == RESULT_OK ) \
? "no error" \
: ( ( r ) == RESULT_FALSE ) \
? "unexpected result" \
: ( ( r ) == RESULT_FAIL ) \
? "general failure" \
: ( ( r ) == RESULT_INVALID_POINTER ) \
? "invalid pointer" \
: ( ( r ) == RESULT_CANCEL ) \
? "operation cancelled" \
: ( ( r ) == RESULT_INVALID_ARGUMENT ) \
? "invalid argument" \
: ( ( r ) == RESULT_ASYNC_INVALID_CALL_ID ) \
? "invalid id" \
: ( ( r ) == RESULT_ASYNC_TIMED_OUT ) \
? "asynchronous timeout" \
: ( ( r ) == \
RESULT_NOT_CONNECTED ) \
? "not connected" \
: ( ( r ) == \
RESULT_NETWORK_TIMED_OUT ) \
? "network " \
"timeout" \
: ( ( r ) == \
RESULT_NETWORK_CONNECT_FAILED ) \
? "network connection failure" \
: ( ( r ) == \
RESULT_NO_DATABASE_CONNECTION ) \
? "no database connection" \
: ( ( r ) == \
RESULT_INVALID_SCHEMA ) \
? "invalid schema" \
: ( ( r ) == \
RESULT_NOT_INITIALIZED ) \
? "uninitialized" \
: ( ( r ) == RESULT_ALREADY_INITIALIZED ) ? "already initialized" \
: ( ( r ) == RESULT_NOT_IMPLEMENTED ) ? "not implemented" \
: ( ( r ) == RESULT_DX_ERROR ) ? "DirectX error" \
: ( ( r ) == \
RESULT_TYPE_CHECK_ERROR ) \
? "type check error" \
: ( ( r ) == RESULT_BLENDING_DISABLED ) ? "blending disabled" \
: ( ( r ) == RESULT_SERVER_INITIALIZATION_FAILED ) ? "server initialization" \
: ( ( r ) == \
RESULT_INJECTION_FAILED ) \
? "injection failed" \
: ( ( r ) == \
RESULT_NO_DWM ) \
? "Aero not enabled" \
: ( ( r ) == \
RESULT_NO_PIXEL_ENGINE ) \
? "no pixel engine" \
: ( ( r ) == \
RESULT_NO_LICENSE_SERVER ) \
? "no license server" \
: ( ( r ) == RESULT_DISPLAY_MISMATCH ) ? "display mismatch" \
: ( ( r ) == \
RESULT_NO_CHANNELS ) \
? "no channels" \
: ( ( r ) == RESULT_MAX_CHANNELS_EXCEEDED ) ? "too many channels" \
: ( ( r ) == \
RESULT_HTTP_OPEN_FAILED ) \
? "http open failure" \
: ( ( r ) == \
RESULT_HTTP_CONNECT_FAILED ) \
? "http connection failure" \
: ( ( r ) == RESULT_HTTP_OPEN_REQUEST_FAILED ) ? "http open request failure" \
: ( ( r ) == \
RESULT_HTTP_SEND_REQUEST_FAILED ) \
? "http send request failure" \
: ( ( r ) == \
RESULT_HTTP_RECV_RESPONSE_FAILED ) \
? "http receive response failure" \
: ( ( r ) == RESULT_HTTP_QUERY_HEADERS_FAILED ) ? "http query headers failure" \
: ( ( r ) == \
RESULT_HTTP_QUERY_DATA_AVAILABLE_FAILED ) \
? "http query data available failure" \
: ( ( r ) == \
RESULT_UNCOMPRESS_FAILED ) \
? "decompression failure" \
: ( ( r ) == \
RESULT_DISPLAY_NOT_FOUND ) \
? "display not found" \
: ( ( r ) == RESULT_LICENSE_MISSING ) ? "license is missing" \
: ( ( r ) == \
RESULT_LICENSE_EXPIRED ) \
? "license is expired" \
: ( ( r ) == RESULT_LICENSE_PRODUCT_MISMATCH ) ? "not licensed to this product" \
: ( ( r ) == \
RESULT_LICENSE_EXCEEDED_CHANNELS ) \
? "exceeds allowed licensed channel" \
: ( ( r ) == \
RESULT_NOT_IN_PUSH ) \
? "not in push state" \
: ( ( r ) == RESULT_NO_TOPOLOGY_INFORMATION ) ? "no topology data" \
: ( ( r ) == \
RESULT_NO_DISPLAY_FOR_DIMENSIONS ) \
? "no display for dimensions" \
: ( ( r ) == RESULT_CALIBRATION_CAPTURE_FAILED ) ? "calibration capture failure" \
: ( ( r ) == RESULT_DETECT_POINTS_FAILED ) ? "detection of points failure" \
: ( ( r ) == \
RESULT_UNIFORMITY_COMPUTATION_FAILED ) \
? "uniformity computation failure" \
: ( ( r ) == RESULT_AUTOFIT_FAILED ) ? "autofit failure" \
: ( ( r ) == \
RESULT_CAMERA_SNAPSHOT_FAILED ) \
? "camera snapshot failure" \
: ( ( r ) == RESULT_CALIBRATION_NOT_SEEING_ALL_POINTS ) ? "camera did not detect all calibration dots" \
: ( ( r ) == RESULT_VALUE_DOES_NOT_EXIST ) ? "value does not exist" \
: ( ( r ) == \
RESULT_UNSUPPORTED_MODEL ) \
? "model is not supported" \
: ( ( r ) == RESULT_CAMERA_NOT_FOUND ) ? "camera not found" \
: ( ( r ) == \
RESULT_BAD_MASK ) \
? "mask is invalid" \
: ( ( r ) == RESULT_BAD_OVERLAP ) ? "overlap region is too small" \
: ( ( r ) == RESULT_MEMORY_ALLOCATION_FAILED ) ? "memory allocation failed" \
: ( ( r ) == \
RESULT_DATA_TOO_BIG ) \
? "data is too big" \
: ( ( r ) == RESULT_WIDTH_HEIGHT_IS_ZERO ) ? "width or height is zero" \
: ( ( r ) == \
RESULT_PROTOCOL_VERSION_MISMATCH ) \
? "protocol version mismatch" \
: ( ( r ) == RESULT_FILE_NOT_FOUND ) ? "specified file not found" \
: ( ( r ) == \
RESULT_INVALID_OBJECT_ID ) \
? "invalid object id" \
: ( ( r ) == RESULT_NETWORK_CONNECTION_NOT_FOUND ) ? "network connection not found" \
: ( ( r ) == RESULT_NETWORK_CONNECTION_NOT_READY_FOR_WRITE ) \
? "connection not ready for write" \
: ( \
( \
r ) == RESULT_LICENSE_CHECKOUT_FAILED ) \
? "license checkout failed" \
: ( ( r ) == RESULT_SOCKET_ERROR ) ? "socket error" \
: ( ( r ) == \
RESULT_INVALID_METHOD_ID ) \
? "invalid method id" \
: ( ( r ) == \
RESULT_NOT_AUTHORIZED ) \
? "not authorized" \
: ( \
( \
r ) == \
RESULT_GL_ERROR ) \
? "opengl error" \
: ( ( r ) == RESULT_FEATURE_DISABLED ) ? "feature disabled" \
: ( ( r ) == RESULT_TERMSERVER ) ? "terminal server / remote desktop use not supported" \
: ( ( r ) == \
RESULT_LICENSE_BROKEN ) \
? "license broken" \
: ( ( r ) == \
RESULT_LICENSE_HOST_MISMATCH ) \
? "license is for another host" \
: ( ( r ) == \
RESULT_LICENSE_TIME_WINDBACK ) \
? "time windback detected" \
: ( ( r ) == \
RESULT_LICENSE_NOT_CHANGED ) \
? "new license is not different from existing license" \
: "Unknown Result"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment