summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLv Meng <meng.lv@intel.com>2014-08-15 09:16:33 +0800
committerYang Rong <rong.r.yang@intel.com>2014-08-19 14:06:08 +0800
commit7197ece4b83162b2f1fea84c6fda040febe7c89f (patch)
treeef5eee41fdc85bd25b0e3bdaabf9bec0f26fc1b6 /src
parentb9334672bfeab9247ff92d0051d93b98b8e3da39 (diff)
Fix compile warnings for CLANG compiler
1.fix data structure redefine warnings. 2.fix 'data' with variable sized type 'union<*>' not at the end of a class warning(in immediate.hpp). 3.fix implicitly conversion warning. 4.fix explicitly assigning a variable type warning. 5.fix comparison of unsigned expression < 0 is always false warning(in cl_api.c). Signed-off-by: Lv Meng <meng.lv@intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/cl_api.c6
-rw-r--r--src/cl_command_queue.c4
-rw-r--r--src/cl_context.h2
-rw-r--r--src/cl_driver.h1
-rw-r--r--src/cl_driver_type.h5
-rw-r--r--src/cl_event.c3
-rw-r--r--src/cl_extensions.h3
-rw-r--r--src/cl_gt_device.h1
-rw-r--r--src/cl_platform_id.h3
-rw-r--r--src/x11/mesa_egl_extension.c1
10 files changed, 12 insertions, 17 deletions
diff --git a/src/cl_api.c b/src/cl_api.c
index 9f702d2..2370dc0 100644
--- a/src/cl_api.c
+++ b/src/cl_api.c
@@ -1910,7 +1910,7 @@ clEnqueueFillBuffer(cl_command_queue command_queue,
goto error;
}
- if (offset < 0 || offset + size > buffer->size) {
+ if (offset + size > buffer->size) {
err = CL_INVALID_VALUE;
goto error;
}
@@ -1992,11 +1992,11 @@ clEnqueueCopyBuffer(cl_command_queue command_queue,
goto error;
}
- if (src_offset < 0 || src_offset + cb > src_buffer->size) {
+ if (src_offset + cb > src_buffer->size) {
err = CL_INVALID_VALUE;
goto error;
}
- if (dst_offset < 0 || dst_offset + cb > dst_buffer->size) {
+ if (dst_offset + cb > dst_buffer->size) {
err = CL_INVALID_VALUE;
goto error;
}
diff --git a/src/cl_command_queue.c b/src/cl_command_queue.c
index 05be801..52e91ae 100644
--- a/src/cl_command_queue.c
+++ b/src/cl_command_queue.c
@@ -141,12 +141,12 @@ cl_command_queue_bind_image(cl_command_queue queue, cl_kernel k)
cl_gpgpu_bind_image(gpgpu, k->images[i].idx, image->base.bo, image->offset,
image->intel_fmt, image->image_type,
image->w, image->h, image->depth,
- image->row_pitch, image->tiling);
+ image->row_pitch, (cl_gpgpu_tiling)image->tiling);
if (image->image_type == CL_MEM_OBJECT_IMAGE1D_ARRAY)
cl_gpgpu_bind_image(gpgpu, k->images[i].idx + 128, image->base.bo, image->offset,
image->intel_fmt, image->image_type,
image->w, image->h, image->depth,
- image->row_pitch, image->tiling);
+ image->row_pitch, (cl_gpgpu_tiling)image->tiling);
}
return CL_SUCCESS;
}
diff --git a/src/cl_context.h b/src/cl_context.h
index f8342d3..8c1e63f 100644
--- a/src/cl_context.h
+++ b/src/cl_context.h
@@ -20,9 +20,9 @@
#ifndef __CL_CONTEXT_H__
#define __CL_CONTEXT_H__
+#include "CL/cl.h"
#include "cl_internals.h"
#include "cl_driver.h"
-#include "CL/cl.h"
#include "cl_khr_icd.h"
#include <stdint.h>
diff --git a/src/cl_driver.h b/src/cl_driver.h
index 9cdba98..38b4830 100644
--- a/src/cl_driver.h
+++ b/src/cl_driver.h
@@ -275,7 +275,6 @@ extern cl_buffer_set_tiling_cb *cl_buffer_set_tiling;
#include "cl_context.h"
#include "cl_mem.h"
-typedef struct _cl_context *cl_context;
typedef cl_buffer (cl_buffer_alloc_from_texture_cb)(cl_context, unsigned int, int, unsigned int,
struct _cl_mem_image *gl_image);
diff --git a/src/cl_driver_type.h b/src/cl_driver_type.h
index 891a33c..c39d3f1 100644
--- a/src/cl_driver_type.h
+++ b/src/cl_driver_type.h
@@ -4,6 +4,8 @@
* will allow us to make the use of a software performance simulator easier and
* to minimize the code specific for the HW and for the simulator
**************************************************************************/
+#ifndef __CL_DRIVER_TYPE_H__
+#define __CL_DRIVER_TYPE_H__
/* Encapsulates command buffer / data buffer / kernels */
typedef struct _cl_buffer *cl_buffer;
@@ -21,4 +23,5 @@ typedef struct _cl_gpgpu *cl_gpgpu;
typedef struct _cl_gpgpu_event *cl_gpgpu_event;
typedef struct _cl_context_prop *cl_context_prop;
-typedef struct _cl_sampler *cl_sampler;
+
+#endif
diff --git a/src/cl_event.c b/src/cl_event.c
index 99e60eb..c3c6dde 100644
--- a/src/cl_event.c
+++ b/src/cl_event.c
@@ -472,9 +472,8 @@ void cl_event_set_status(cl_event event, cl_int status)
/* All user events complete, now wait enqueue events */
ret = cl_event_wait_events(enqueue_cb->num_events, enqueue_cb->wait_list,
enqueue_cb->event->queue);
- ret = ret;
assert(ret != CL_ENQUEUE_EXECUTE_DEFER);
-
+ ret = ~ret;
cb = enqueue_cb;
enqueue_cb = enqueue_cb->next;
diff --git a/src/cl_extensions.h b/src/cl_extensions.h
index 52ee0a4..e6cdce8 100644
--- a/src/cl_extensions.h
+++ b/src/cl_extensions.h
@@ -92,8 +92,5 @@ typedef struct cl_extensions {
char ext_str[256];
} cl_extensions_t;
-struct _cl_platform_id;
-typedef struct _cl_platform_id * cl_platform_id;
-
extern void
cl_intel_platform_extension_init(cl_platform_id intel_platform);
diff --git a/src/cl_gt_device.h b/src/cl_gt_device.h
index fc8aefd..33ef1f0 100644
--- a/src/cl_gt_device.h
+++ b/src/cl_gt_device.h
@@ -51,7 +51,6 @@
.max_samplers = 16,
.mem_base_addr_align = sizeof(cl_long) * 16 * 8,
.min_data_type_align_size = sizeof(cl_long) * 16,
-.single_fp_config = 0, /* XXX */
.double_fp_config = 0,
.global_mem_cache_type = CL_READ_WRITE_CACHE,
.global_mem_size = 1024 * 1024 * 1024,
diff --git a/src/cl_platform_id.h b/src/cl_platform_id.h
index 2a9c07a..61b8eab 100644
--- a/src/cl_platform_id.h
+++ b/src/cl_platform_id.h
@@ -20,11 +20,10 @@
#ifndef __CL_PLATFORM_ID_H__
#define __CL_PLATFORM_ID_H__
+#include "CL/cl.h"
#include "cl_internals.h"
#include "cl_extensions.h"
#include "cl_khr_icd.h"
-#include "CL/cl.h"
-
#include "src/OCLConfig.h"
struct _cl_platform_id {
diff --git a/src/x11/mesa_egl_extension.c b/src/x11/mesa_egl_extension.c
index a7fc8cb..4a3e89c 100644
--- a/src/x11/mesa_egl_extension.c
+++ b/src/x11/mesa_egl_extension.c
@@ -123,7 +123,6 @@ _eglLockDisplay(EGLDisplay dpy)
static _EGLContext *
_eglLookupContext(EGLContext ctx, EGLDisplay disp)
{
- disp = disp;
return (_EGLContext *) ctx;
}