diff options
author | Sean Paul <seanpaul@chromium.org> | 2015-02-09 02:31:58 -0500 |
---|---|---|
committer | Tomasz Figa <tfiga@google.com> | 2015-05-30 15:51:12 +0900 |
commit | d225ab0eaecac84e5fd7199968a433a462af0196 (patch) | |
tree | 7af9ee765dc171207366bf2007d4da667f3f0ffe | |
parent | 9b27aa890b10d27733dd6f4dc40fe006a2a87ad2 (diff) | |
download | drm_gralloc-d225ab0eaecac84e5fd7199968a433a462af0196.tar.gz |
drm_gralloc: Move gralloc.c and gralloc_drm.c to cpp
Change-Id: Id08a921c74fc431328ed92bb94bfeaa5764c3e5c
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Tomasz Figa <tfiga@google.com>
-rw-r--r-- | Android.mk | 4 | ||||
-rw-r--r-- | gralloc.cpp (renamed from gralloc.c) | 4 | ||||
-rw-r--r-- | gralloc_drm.cpp (renamed from gralloc_drm.c) | 12 |
3 files changed, 10 insertions, 10 deletions
@@ -82,7 +82,7 @@ LOCAL_MODULE := libgralloc_drm LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES := \ - gralloc_drm.c + gralloc_drm.cpp LOCAL_C_INCLUDES := \ external/libdrm \ @@ -150,7 +150,7 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_SRC_FILES := \ - gralloc.c \ + gralloc.cpp LOCAL_C_INCLUDES := \ external/libdrm \ @@ -152,7 +152,7 @@ static int drm_mod_close_gpu0(struct hw_device_t *dev) { struct alloc_device_t *alloc = (struct alloc_device_t *) dev; - free(alloc); + delete alloc; return 0; } @@ -203,7 +203,7 @@ static int drm_mod_open_gpu0(struct drm_module_t *dmod, hw_device_t **dev) if (err) return err; - alloc = calloc(1, sizeof(*alloc)); + alloc = new alloc_device_t; if (!alloc) return -EINVAL; diff --git a/gralloc_drm.c b/gralloc_drm.cpp index e74b423..8826f73 100644 --- a/gralloc_drm.c +++ b/gralloc_drm.cpp @@ -104,7 +104,7 @@ struct gralloc_drm_t *gralloc_drm_create(void) struct gralloc_drm_t *drm; int err; - drm = calloc(1, sizeof(*drm)); + drm = new gralloc_drm_t; if (!drm) return NULL; @@ -117,7 +117,7 @@ struct gralloc_drm_t *gralloc_drm_create(void) drm->drv = init_drv_from_fd(drm->fd); if (!drm->drv) { close(drm->fd); - free(drm); + delete drm; return NULL; } @@ -132,7 +132,7 @@ void gralloc_drm_destroy(struct gralloc_drm_t *drm) if (drm->drv) drm->drv->destroy(drm->drv); close(drm->fd); - free(drm); + delete drm; } /* @@ -250,7 +250,7 @@ static struct gralloc_drm_handle_t *create_bo_handle(int width, { struct gralloc_drm_handle_t *handle; - handle = calloc(1, sizeof(*handle)); + handle = new gralloc_drm_handle_t; if (!handle) return NULL; @@ -282,7 +282,7 @@ struct gralloc_drm_bo_t *gralloc_drm_bo_create(struct gralloc_drm_t *drm, bo = drm->drv->alloc(drm->drv, handle); if (!bo) { - free(handle); + delete handle; return NULL; } @@ -316,7 +316,7 @@ static void gralloc_drm_bo_destroy(struct gralloc_drm_bo_t *bo) handle->data = 0; } else { - free(handle); + delete handle; } } |