diff options
author | Sean Paul <seanpaul@chromium.org> | 2015-06-04 12:08:03 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-06-04 12:08:03 +0000 |
commit | 639ceae67f2bb2fcafe876f50fd997e8e2e626d2 (patch) | |
tree | 7af9ee765dc171207366bf2007d4da667f3f0ffe | |
parent | ce279844b5d02c541f026fe1bf1c083b43a09746 (diff) | |
parent | d225ab0eaecac84e5fd7199968a433a462af0196 (diff) | |
download | drm_gralloc-639ceae67f2bb2fcafe876f50fd997e8e2e626d2.tar.gz |
am d225ab0e: drm_gralloc: Move gralloc.c and gralloc_drm.c to cpp
* commit 'd225ab0eaecac84e5fd7199968a433a462af0196':
drm_gralloc: Move gralloc.c and gralloc_drm.c to cpp
-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; } } |