Commit 9b4a9246 authored by Slava Monich's avatar Slava Monich

[mms-engine] Replaced MMS_CAST with G_CAST. MER#1027

parent e3f703c0
......@@ -31,6 +31,7 @@
/* Generated code */
#include "org.nemomobile.MmsEngine.h"
#include <gutil_macros.h>
#include <gutil_misc.h>
#include <gutil_log.h>
......@@ -76,7 +77,7 @@ G_DEFINE_TYPE(MMSEngine, mms_engine, G_TYPE_OBJECT)
inline static MMSEngine*
mms_engine_from_dispatcher_delegate(MMSDispatcherDelegate* delegate)
{ return MMS_CAST(delegate,MMSEngine,dispatcher_delegate); }
{ return G_CAST(delegate,MMSEngine,dispatcher_delegate); }
static
gboolean
......
......@@ -10,7 +10,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef JOLLA_MMS_LIB_TYPES_H
......@@ -82,10 +81,6 @@ typedef enum _MMS_CONNECTION_TYPE {
MMS_CONNECTION_TYPE_USER /* Connection requested by user */
} MMS_CONNECTION_TYPE;
/* Convenience macros */
#define MMS_CAST(address,type,field) \
((type *)((guint8*)(address) - G_STRUCT_OFFSET(type,field)))
#endif /* JOLLA_MMS_LIB_TYPES_H */
/*
......
......@@ -15,6 +15,8 @@
#include "mms_attachment_image.h"
#include "mms_file_util.h"
#include <gutil_macros.h>
#include <jpeglib.h>
#include <jerror.h>
#include <setjmp.h>
......@@ -47,7 +49,7 @@ typedef struct mms_attachment_jpeg_resize {
static inline MMSAttachmentJpegResize*
mms_attachment_jpeg_resize_cast(MMSAttachmentImageResize* resize)
{ return MMS_CAST(resize, MMSAttachmentJpegResize, pub); }
{ return G_CAST(resize, MMSAttachmentJpegResize, pub); }
static
void
......
......@@ -23,6 +23,8 @@
#include "mms_util.h"
#include "mms_task.h"
#include <gutil_macros.h>
#include <errno.h>
/* Logging */
......@@ -57,7 +59,7 @@ typedef struct mms_dispatcher_idle_callback {
inline static MMSDispatcher*
mms_dispatcher_from_task_delegate(MMSTaskDelegate* delegate)
{ return MMS_CAST(delegate,MMSDispatcher,task_delegate); }
{ return G_CAST(delegate,MMSDispatcher,task_delegate); }
static
void
......
......@@ -15,6 +15,8 @@
#include "test_handler.h"
#include "mms_dispatcher.h"
#include <gutil_macros.h>
/* Logging */
#define GLOG_MODULE_NAME mms_handler_log
#include <gutil_log.h>
......@@ -104,7 +106,7 @@ MMSHandlerRecordSend*
mms_handler_test_record_send(MMSHandlerRecord* rec)
{
GASSERT(rec->type == MMS_HANDLER_RECORD_SEND);
return MMS_CAST(rec, MMSHandlerRecordSend, rec);
return G_CAST(rec, MMSHandlerRecordSend, rec);
}
static inline
......@@ -112,7 +114,7 @@ MMSHandlerRecordReceive*
mms_handler_test_record_receive(MMSHandlerRecord* rec)
{
GASSERT(rec->type == MMS_HANDLER_RECORD_RECEIVE);
return MMS_CAST(rec, MMSHandlerRecordReceive, rec);
return G_CAST(rec, MMSHandlerRecordReceive, rec);
}
static
......
......@@ -23,6 +23,7 @@
#include "mms_settings.h"
#include "mms_dispatcher.h"
#include <gutil_macros.h>
#include <gutil_log.h>
#include <gio/gio.h>
......@@ -80,7 +81,7 @@ test_done(
MMSDispatcherDelegate* delegate,
MMSDispatcher* dispatcher)
{
Test* test = MMS_CAST(delegate,Test,delegate);
Test* test = G_CAST(delegate,Test,delegate);
const TestDesc* desc = test->desc;
const char* name = desc->name;
if (test->ret == RET_OK) {
......
......@@ -25,6 +25,7 @@
#include "mms_settings.h"
#include "mms_dispatcher.h"
#include <gutil_macros.h>
#include <gutil_log.h>
#include <libsoup/soup-status.h>
......@@ -513,7 +514,7 @@ test_done(
MMSDispatcherDelegate* delegate,
MMSDispatcher* dispatcher)
{
Test* test = MMS_CAST(delegate,Test,delegate);
Test* test = G_CAST(delegate,Test,delegate);
if (!mms_handler_test_receive_pending(test->handler, NULL)) {
test_finish(test);
}
......
......@@ -24,6 +24,7 @@
#include "mms_settings.h"
#include "mms_dispatcher.h"
#include <gutil_macros.h>
#include <gutil_log.h>
#include <gio/gio.h>
#include <libsoup/soup-status.h>
......@@ -95,7 +96,7 @@ test_done(
MMSDispatcherDelegate* delegate,
MMSDispatcher* dispatcher)
{
Test* test = MMS_CAST(delegate,Test,delegate);
Test* test = G_CAST(delegate,Test,delegate);
test_finish(test);
}
......
......@@ -24,6 +24,7 @@
#include "mms_settings.h"
#include "mms_dispatcher.h"
#include <gutil_macros.h>
#include <gutil_log.h>
#include <libsoup/soup-status.h>
......@@ -152,7 +153,7 @@ test_done(
MMSDispatcherDelegate* delegate,
MMSDispatcher* dispatcher)
{
Test* test = MMS_CAST(delegate,Test,delegate);
Test* test = G_CAST(delegate,Test,delegate);
if (!mms_handler_test_receive_pending(test->handler, NULL)) {
test_finish(test);
}
......
......@@ -24,6 +24,7 @@
#include "mms_settings.h"
#include "mms_dispatcher.h"
#include <gutil_macros.h>
#include <gutil_log.h>
#include <gio/gio.h>
#include <libsoup/soup-status.h>
......@@ -315,7 +316,7 @@ test_done(
MMSDispatcherDelegate* delegate,
MMSDispatcher* dispatcher)
{
Test* test = MMS_CAST(delegate,Test,delegate);
Test* test = G_CAST(delegate,Test,delegate);
if (!mms_handler_test_receive_pending(test->handler, NULL)) {
test_finish(test);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment