summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-04-05 10:55:44 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-04-05 10:55:44 +0200
commit17f6a909f94e0058760ddac9ff5cd1fe669b7073 (patch)
treead1e162d3c983e27d250d446fb81fdfbd49bc01a
parent1f5986eb53b26a4d05be63796c24184d73b62656 (diff)
wfdapi: Reset error after fetching display object
-rw-r--r--src/wfdapi.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/wfdapi.c b/src/wfdapi.c
index 96bb6b6..1e807e5 100644
--- a/src/wfdapi.c
+++ b/src/wfdapi.c
@@ -175,6 +175,7 @@ wfdDeviceCommit(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
switch (type) {
case WFD_COMMIT_PIPELINE:
@@ -202,8 +203,6 @@ wfdDeviceCommit(WFDDevice device_handle,
wfd_device_set_error(device, WFD_ERROR_ILLEGAL_ARGUMENT);
return;
}
-
- wfd_device_set_error(device, WFD_ERROR_NONE);
}
@@ -225,6 +224,7 @@ wfdCreateEvent(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return WFD_INVALID_HANDLE;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
if (attribList != NULL && attribList[0] != WFD_NONE) {
if (attribList[0] != WFD_EVENT_PIPELINE_BIND_QUEUE_SIZE ||
@@ -261,6 +261,7 @@ wfdDestroyEvent(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
event = wf_handle_get_object(event_handle, EVENT_HANDLE);
if (event == NULL) {
@@ -270,8 +271,6 @@ wfdDestroyEvent(WFDDevice device_handle,
wf_handle_destroy(event_handle);
wfd_event_destroy(device, event);
-
- wfd_device_set_error(device, WFD_ERROR_NONE);
}
WFD_API_CALL WFDint WFD_APIENTRY
@@ -285,6 +284,7 @@ wfdGetEventAttribi(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return 0;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
event = wf_handle_get_object(event_handle, EVENT_HANDLE);
if (event == NULL) {
@@ -305,6 +305,7 @@ wfdDeviceEventGetFD(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return -1;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
event = wf_handle_get_object(event_handle, EVENT_HANDLE);
if (event == NULL) {
@@ -335,6 +336,7 @@ wfdDeviceEventWait(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return WFD_EVENT_NONE;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
event = wf_handle_get_object(event_handle, EVENT_HANDLE);
if (event == NULL) {
@@ -372,6 +374,7 @@ wfdEnumeratePorts(WFDDevice device_handle,
if (device == NULL) {
return 0;
}
+ wfd_device_set_error(device, WFD_ERROR_NONE);
if (portIds != NULL && idsCount <= 0) {
wfd_device_set_error(device, WFD_ERROR_ILLEGAL_ARGUMENT);
@@ -400,6 +403,7 @@ wfdCreatePort(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return WFD_INVALID_HANDLE;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
if (attribList != NULL && attribList[0] != WFD_NONE) {
wfd_device_set_error(device, WFD_ERROR_BAD_ATTRIBUTE);
@@ -435,6 +439,7 @@ wfdDestroyPort(WFDDevice device_handle, WFDPort port_handle) WFD_APIEXIT
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
port = wf_handle_get_object(port_handle, PORT_HANDLE);
if (port == NULL) {
@@ -461,6 +466,7 @@ wfdGetPortModes(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return 0;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
port = wf_handle_get_object(port_handle, PORT_HANDLE);
if (port == NULL) {
@@ -484,6 +490,7 @@ wfdGetPortModeAttribi(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return 0;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
port = wf_handle_get_object(port_handle, PORT_HANDLE);
if (port == NULL) {
@@ -514,6 +521,7 @@ wfdSetPortMode(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
port = wf_handle_get_object(port_handle, PORT_HANDLE);
if (port == NULL) {
@@ -542,6 +550,7 @@ wfdGetPortAttribi(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return 0;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
port = wf_handle_get_object(port_handle, PORT_HANDLE);
if (port == NULL) {
@@ -552,7 +561,6 @@ wfdGetPortAttribi(WFDDevice device_handle,
return wfd_port_get_attribi(device, port, attrib);
}
-
WFD_API_CALL WFDfloat WFD_APIENTRY
wfdGetPortAttribf(WFDDevice device,
WFDPort port,
@@ -575,6 +583,7 @@ wfdGetPortAttribiv(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
port = wf_handle_get_object(port_handle, PORT_HANDLE);
if (port == NULL) {
@@ -653,6 +662,7 @@ wfdBindPipelineToPort(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
port = wf_handle_get_object(port_handle, PORT_HANDLE);
if (port == NULL) {
@@ -707,6 +717,7 @@ wfdEnumeratePipelines(WFDDevice device_handle,
fprintf(stderr, "bad device\n");
return 0;
}
+ wfd_device_set_error(device, WFD_ERROR_NONE);
if (pipelineIds != NULL && idsCount <= 0) {
wfd_device_set_error(device, WFD_ERROR_ILLEGAL_ARGUMENT);
@@ -736,6 +747,7 @@ wfdCreatePipeline(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return WFD_INVALID_HANDLE;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
if (attribList != NULL && attribList[0] != WFD_NONE) {
wfd_device_set_error(device, WFD_ERROR_BAD_ATTRIBUTE);
@@ -772,6 +784,7 @@ wfdDestroyPipeline(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
pipeline = wf_handle_get_object(pipeline_handle, PIPELINE_HANDLE);
if (pipeline == NULL) {
@@ -799,6 +812,7 @@ wfdCreateSourceFromImage(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return WFD_INVALID_HANDLE;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
pipeline = wf_handle_get_object(pipeline_handle, PIPELINE_HANDLE);
if (pipeline == NULL) {
@@ -843,6 +857,7 @@ wfdDestroySource(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
source = wf_handle_get_object(source_handle, SOURCE_HANDLE);
if (source == NULL) {
@@ -896,6 +911,7 @@ wfdBindSourceToPipeline(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
pipeline = wf_handle_get_object(pipeline_handle, PIPELINE_HANDLE);
if (pipeline == NULL) {
@@ -990,6 +1006,7 @@ wfdSetPipelineAttribiv(WFDDevice device_handle,
device = wf_handle_get_object(device_handle, DEVICE_HANDLE);
if (device == NULL)
return;
+ wfd_device_set_error(device, WFD_ERROR_NONE);
pipeline = wf_handle_get_object(pipeline_handle, PIPELINE_HANDLE);
if (pipeline == NULL) {