You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by Ferry Huberts <ma...@hupie.com> on 2012/07/13 23:35:43 UTC
[RFC] [PATCH v1 0/9] More Fixes
From: Ferry Huberts <fe...@pelagic.nl>
Please review. The patches need it ;-)
Ferry Huberts (9):
add some include paths
add forgotten include
fix compiler warning about extra symbols after ifdef
fix compiler warning about implicit declaration
hessian: add forgotten include
add linux/limits.h includes
MAXNAMLEN is actually called NAME_MAX
eclipse: update include paths
use gtk accessor functions
.cproject | 6 ++++--
deployment_admin/private/include/miniunz.h | 15 +++++++++++++++
deployment_admin/private/src/deployment_admin.c | 7 +++++--
deployment_admin/private/src/miniunz.c | 4 +++-
examples/mongoose/mongoose.c | 2 ++
.../circle/private/src/circle_shape.c | 6 +++---
.../paint/private/src/default_shape.c | 2 +-
.../paint/private/src/paint_frame.c | 19 +++++++++++++------
.../simple/public/include/simple_shape.h | 2 ++
.../square/private/src/square_shape.c | 2 +-
.../triangle/private/src/triangle_shape.c | 2 +-
hessian/source/private/test/test_service_skeleton.c | 2 ++
.../remote_service_admin/private/src/mongoose.c | 2 ++
.../private/src/mongoose.c | 2 ++
shell/update_command.c | 4 +++-
15 files changed, 59 insertions(+), 18 deletions(-)
create mode 100644 deployment_admin/private/include/miniunz.h
--
1.7.10.4
[RFC] [PATCH v1 6/9] add linux/limits.h includes
Posted by Ferry Huberts <ma...@hupie.com>.
From: Ferry Huberts <fe...@pelagic.nl>
Signed-off-by: Ferry Huberts <fe...@pelagic.nl>
---
examples/mongoose/mongoose.c | 2 ++
remote_services/remote_service_admin/private/src/mongoose.c | 2 ++
remote_services/remote_service_admin_http/private/src/mongoose.c | 2 ++
3 files changed, 6 insertions(+)
diff --git a/examples/mongoose/mongoose.c b/examples/mongoose/mongoose.c
index b34818f..e15da45 100644
--- a/examples/mongoose/mongoose.c
+++ b/examples/mongoose/mongoose.c
@@ -33,6 +33,8 @@
#include <fcntl.h>
#endif // !_WIN32_WCE
+#include <linux/limits.h>
+
#include <time.h>
#include <stdlib.h>
#include <stdarg.h>
diff --git a/remote_services/remote_service_admin/private/src/mongoose.c b/remote_services/remote_service_admin/private/src/mongoose.c
index 117859e..ada7bc3 100644
--- a/remote_services/remote_service_admin/private/src/mongoose.c
+++ b/remote_services/remote_service_admin/private/src/mongoose.c
@@ -40,6 +40,8 @@
#include <fcntl.h>
#endif // !_WIN32_WCE
+#include <linux/limits.h>
+
#include <time.h>
#include <stdlib.h>
#include <stdarg.h>
diff --git a/remote_services/remote_service_admin_http/private/src/mongoose.c b/remote_services/remote_service_admin_http/private/src/mongoose.c
index 117859e..ada7bc3 100644
--- a/remote_services/remote_service_admin_http/private/src/mongoose.c
+++ b/remote_services/remote_service_admin_http/private/src/mongoose.c
@@ -40,6 +40,8 @@
#include <fcntl.h>
#endif // !_WIN32_WCE
+#include <linux/limits.h>
+
#include <time.h>
#include <stdlib.h>
#include <stdarg.h>
--
1.7.10.4
Re: [RFC] [PATCH v1 0/9] More Fixes
Posted by Alexander Broekhuis <a....@gmail.com>.
Hi,
> Ferry Huberts wrote:
>>
>> however, I saw you didn't preserve my authorship of miniunz.h,
>>> which is considered 'bad taste' in open source projects...
>>>
>>
My mistake here, I didn't take the patch as is, but only the changed lines.
My Eclipse adds the default header. Never intended to do any harm or add my
own name explicitly.
>
>> For the record, it is quite common in Apache projects to not name an
>> individual author in source files, but instead mention the
>> development team. For example, in Felix we have the following
>>
>
> ok, cool.
> I didn't contribute to many apache projects yet ;-)
> I just followed the convention that was in the source files
I agree with Marcel, as mentioned, the header is from my default Eclipse
setup. Since we are working towards a release, all headers have to be
checked for the Apache license. So I'll take this into account and
remove/change the Eclipse headers.
>
> convention:
>>
>> * @author <a href="mailto:dev@felix.apache.**org <de...@felix.apache.org>">Felix
>> Project
>> Team</a>
>>
>> I would suggest the Celix team considers this suggestion.
>>
>
+1.
--
Met vriendelijke groet,
Alexander Broekhuis
Re: [RFC] [PATCH v1 0/9] More Fixes
Posted by Ferry Huberts <ma...@hupie.com>.
On 08-08-12 16:57, Marcel Offermans wrote:
> On Aug 8, 2012, at 16:47 PM, Ferry Huberts wrote:
>
>> however, I saw you didn't preserve my authorship of miniunz.h,
>> which is considered 'bad taste' in open source projects...
>
> For the record, it is quite common in Apache projects to not name an
> individual author in source files, but instead mention the
> development team. For example, in Felix we have the following
ok, cool.
I didn't contribute to many apache projects yet ;-)
I just followed the convention that was in the source files
> convention:
>
> * @author <a href="mailto:dev@felix.apache.org">Felix Project
> Team</a>
>
> I would suggest the Celix team considers this suggestion.
>
> Greetings, Marcel
>
--
Ferry Huberts
Re: [RFC] [PATCH v1 0/9] More Fixes
Posted by Marcel Offermans <ma...@luminis.nl>.
On Aug 8, 2012, at 16:47 PM, Ferry Huberts wrote:
> however, I saw you didn't preserve my authorship of miniunz.h, which is considered 'bad taste' in open source projects...
For the record, it is quite common in Apache projects to not name an individual author in source files, but instead mention the development team. For example, in Felix we have the following convention:
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
I would suggest the Celix team considers this suggestion.
Greetings, Marcel
Re: [RFC] [PATCH v1 0/9] More Fixes
Posted by Ferry Huberts <ma...@hupie.com>.
On 08-08-12 15:45, Alexander Broekhuis wrote:
> 2012/8/8 Alexander Broekhuis <a....@gmail.com>
>
>> I've worked through these patches and applied most of them.
>
>
> The patches have been committed in [1]. Probably [2] is also needed to
> compile (some file moves where taken into the 1st commit).
>
> [1]: http://svn.apache.org/viewvc?rev=1370760&view=rev
> [2]: http://svn.apache.org/viewvc?rev=1370761&view=rev
>
> If you find some time, could you verify if everything has been fixed?
> (taken my previous message into account..).
thanks for applying.
everything seems to be fixed.
however, I saw you didn't preserve my authorship of miniunz.h, which is
considered 'bad taste' in open source projects...
my rebased branch compared to trunk:
> - * Created on: Aug 8, 2012
> - * Author: alexander
> + * Created on: Jul 13, 2012
> + * Author: Ferry Huberts
>
>
--
Ferry Huberts
Re: [RFC] [PATCH v1 0/9] More Fixes
Posted by Alexander Broekhuis <a....@gmail.com>.
2012/8/8 Alexander Broekhuis <a....@gmail.com>
> I've worked through these patches and applied most of them.
The patches have been committed in [1]. Probably [2] is also needed to
compile (some file moves where taken into the 1st commit).
[1]: http://svn.apache.org/viewvc?rev=1370760&view=rev
[2]: http://svn.apache.org/viewvc?rev=1370761&view=rev
If you find some time, could you verify if everything has been fixed?
(taken my previous message into account..).
--
Met vriendelijke groet,
Alexander Broekhuis
Re: [RFC] [PATCH v1 0/9] More Fixes
Posted by Alexander Broekhuis <a....@gmail.com>.
I've worked through these patches and applied most of them.
I've ignored the path specific problems since on the command line I don't
see any warnings at this moment.
And as mentioned before, I'll look into the Eclipse project and if it can
be generated by CMake. Maintaining one project file which works on multiple
systems might be impossible.
Thanks for the patches! Really appreciated.
>> I asked for review because I could not find something like a __linux__
>> define
>>
>> I work on olsr as well, and that codebase is very cross platform but
>> there we have many parts that are OS specific. IMHO you can't avoid that
>> in cross platform code...
>>
>
I agree, I was just curious what the cause of the warnings was. I haven't
seen them before on my system (linux and osx).
--
Met vriendelijke groet,
Alexander Broekhuis
Re: [RFC] [PATCH v1 0/9] More Fixes
Posted by Ferry Huberts <ma...@hupie.com>.
On 14-07-12 09:54, Ferry Huberts wrote:
>
>
> On 14-07-12 09:09, Alexander Broekhuis wrote:
>> Hi Ferry,
>>
>> Thanks for the patches! I'll look into it tomorrow or somewhere next
>> week.
>>
>> Some things I notice:
>>
>> Eclipse path: normally eclipse should pick up the includes itself if
>> compilation is done from within eclipse. I do have mixed result with this
>> however, so I'll check if the mentioned includes are any problem.
>>
>
> it should but they were there in the include file
fix:
it should but they were there in the project file already
>
>> Added linux/limits.h: Celix doesn't only target Linux as platform, as
>> such
>> I don't think those should be added. What are the errors/warnings
>> resulting
>> in this needed header? I think it is important to keep the code clean
>> from
>
> eclipse complains about stuff.
>
> I asked for review because I could not find something like a __linux__
> define
>
> I work on olsr as well, and that codebase is very cross platform but
> there we have many parts that are OS specific. IMHO you can't avoid that
> in cross platform code...
>
>> platform specific solutions (at least, all new code, I guess several
>> older
>> parts aren't that clean). But everything at least also compiles on OSX,
>> which definitely doesn't have a linux/limits.h.
>> If something is going wrong we'll have to check out a platform
>> independent
>> solution.
>>
>> The others I'll need to check out.
>
> tnx
>
--
Ferry Huberts
Re: [RFC] [PATCH v1 0/9] More Fixes
Posted by Ferry Huberts <ma...@hupie.com>.
On 14-07-12 09:09, Alexander Broekhuis wrote:
> Hi Ferry,
>
> Thanks for the patches! I'll look into it tomorrow or somewhere next week.
>
> Some things I notice:
>
> Eclipse path: normally eclipse should pick up the includes itself if
> compilation is done from within eclipse. I do have mixed result with this
> however, so I'll check if the mentioned includes are any problem.
>
it should but they were there in the include file
> Added linux/limits.h: Celix doesn't only target Linux as platform, as such
> I don't think those should be added. What are the errors/warnings resulting
> in this needed header? I think it is important to keep the code clean from
eclipse complains about stuff.
I asked for review because I could not find something like a __linux__
define
I work on olsr as well, and that codebase is very cross platform but
there we have many parts that are OS specific. IMHO you can't avoid that
in cross platform code...
> platform specific solutions (at least, all new code, I guess several older
> parts aren't that clean). But everything at least also compiles on OSX,
> which definitely doesn't have a linux/limits.h.
> If something is going wrong we'll have to check out a platform independent
> solution.
>
> The others I'll need to check out.
tnx
--
Ferry Huberts
Re: [RFC] [PATCH v1 0/9] More Fixes
Posted by Alexander Broekhuis <a....@gmail.com>.
Hi Ferry,
Thanks for the patches! I'll look into it tomorrow or somewhere next week.
Some things I notice:
Eclipse path: normally eclipse should pick up the includes itself if
compilation is done from within eclipse. I do have mixed result with this
however, so I'll check if the mentioned includes are any problem.
Added linux/limits.h: Celix doesn't only target Linux as platform, as such
I don't think those should be added. What are the errors/warnings resulting
in this needed header? I think it is important to keep the code clean from
platform specific solutions (at least, all new code, I guess several older
parts aren't that clean). But everything at least also compiles on OSX,
which definitely doesn't have a linux/limits.h.
If something is going wrong we'll have to check out a platform independent
solution.
The others I'll need to check out.
--
Met vriendelijke groet,
Alexander Broekhuis
[RFC] [PATCH v1 3/9] fix compiler warning about extra symbols after ifdef
Posted by Ferry Huberts <ma...@hupie.com>.
From: Ferry Huberts <fe...@pelagic.nl>
Signed-off-by: Ferry Huberts <fe...@pelagic.nl>
---
deployment_admin/private/src/miniunz.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/deployment_admin/private/src/miniunz.c b/deployment_admin/private/src/miniunz.c
index cf026e4..c3980f0 100644
--- a/deployment_admin/private/src/miniunz.c
+++ b/deployment_admin/private/src/miniunz.c
@@ -81,7 +81,7 @@ void change_file_date(filename,dosdate,tmu_date)
SetFileTime(hFile,&ftm,&ftLastAcc,&ftm);
CloseHandle(hFile);
#else
-#ifdef unix || __APPLE__
+#if defined unix || defined __APPLE__
struct utimbuf ut;
struct tm newdate;
newdate.tm_sec = tmu_date.tm_sec;
--
1.7.10.4
Re: [RFC] [PATCH v1 7/9] MAXNAMLEN is actually called NAME_MAX
Posted by Alexander Broekhuis <a....@gmail.com>.
Hi,
I've been working through these patches and don't think this one is needed.
MAXNAMLEN is defined in dirent.h and check if NAME_MAX is defined or not.
Because of this the include to limits.h also isn't needed.
I've tested this on the commandline using gcc 4.3.6 (on a Fedora 16
system), I'll also check out Eclipse, but errors/warnings given by Eclipse
seem to be an Eclipse path problem.
I am not sure wether we should try to fix this or not, since the Eclipse
project is messy to maintain in a repository since every system can have
different include paths.
CMake can also generate an Eclipse project using the configured path. If
time permits, I'll take a look into that.
2012/7/13 Ferry Huberts <ma...@hupie.com>
> From: Ferry Huberts <fe...@pelagic.nl>
>
> Signed-off-by: Ferry Huberts <fe...@pelagic.nl>
> ---
> deployment_admin/private/src/deployment_admin.c | 6 ++++--
> shell/update_command.c | 4 +++-
> 2 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/deployment_admin/private/src/deployment_admin.c
> b/deployment_admin/private/src/deployment_admin.c
> index 5065b5f..de0333f 100644
> --- a/deployment_admin/private/src/deployment_admin.c
> +++ b/deployment_admin/private/src/deployment_admin.c
> @@ -12,6 +12,8 @@
> #include <curl/easy.h>
> #include <apr_strings.h>
>
> +#include <linux/limits.h>
> +
> #include "deployment_admin.h"
> #include "celix_errno.h"
> #include "bundle_context.h"
> @@ -115,13 +117,13 @@ static void *APR_THREAD_FUNC
> deploymentAdmin_poll(apr_thread_t *thd, void *deplo
> request = apr_pstrcat(admin->pool,
> admin->pollUrl, "/", last, NULL);
> }
>
> - char inputFile[MAXNAMLEN];
> + char inputFile[NAME_MAX];
> inputFile[0] = '\0';
> char *test = inputFile;
> celix_status_t status =
> deploymentAdmin_download(request, &test);
> if (status == CELIX_SUCCESS) {
> // Handle file
> - char tmpDir[MAXNAMLEN];
> + char tmpDir[NAME_MAX];
> tmpDir[0] = '\0';
> tmpnam(tmpDir);
>
> diff --git a/shell/update_command.c b/shell/update_command.c
> index aab412e..62c455d 100644
> --- a/shell/update_command.c
> +++ b/shell/update_command.c
> @@ -28,6 +28,8 @@
> #include <curl/curl.h>
> #include <curl/easy.h>
>
> +#include <linux/limits.h>
> +
> #include "command_private.h"
> #include "array_list.h"
> #include "bundle_context.h"
> @@ -65,7 +67,7 @@ void updateCommand_execute(COMMAND command, char * line,
> void (*out)(char *), vo
> bundleContext_getBundleById(command->bundleContext, id,
> &bundle);
> if (bundle != NULL) {
> sub = strtok(NULL, delims);
> - char inputFile[MAXNAMLEN];
> + char inputFile[NAME_MAX];
> inputFile[0] = '\0';
> if (sub != NULL) {
> printf("URL: %s\n", sub);
> --
> 1.7.10.4
>
>
--
Met vriendelijke groet,
Alexander Broekhuis
[RFC] [PATCH v1 7/9] MAXNAMLEN is actually called NAME_MAX
Posted by Ferry Huberts <ma...@hupie.com>.
From: Ferry Huberts <fe...@pelagic.nl>
Signed-off-by: Ferry Huberts <fe...@pelagic.nl>
---
deployment_admin/private/src/deployment_admin.c | 6 ++++--
shell/update_command.c | 4 +++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/deployment_admin/private/src/deployment_admin.c b/deployment_admin/private/src/deployment_admin.c
index 5065b5f..de0333f 100644
--- a/deployment_admin/private/src/deployment_admin.c
+++ b/deployment_admin/private/src/deployment_admin.c
@@ -12,6 +12,8 @@
#include <curl/easy.h>
#include <apr_strings.h>
+#include <linux/limits.h>
+
#include "deployment_admin.h"
#include "celix_errno.h"
#include "bundle_context.h"
@@ -115,13 +117,13 @@ static void *APR_THREAD_FUNC deploymentAdmin_poll(apr_thread_t *thd, void *deplo
request = apr_pstrcat(admin->pool, admin->pollUrl, "/", last, NULL);
}
- char inputFile[MAXNAMLEN];
+ char inputFile[NAME_MAX];
inputFile[0] = '\0';
char *test = inputFile;
celix_status_t status = deploymentAdmin_download(request, &test);
if (status == CELIX_SUCCESS) {
// Handle file
- char tmpDir[MAXNAMLEN];
+ char tmpDir[NAME_MAX];
tmpDir[0] = '\0';
tmpnam(tmpDir);
diff --git a/shell/update_command.c b/shell/update_command.c
index aab412e..62c455d 100644
--- a/shell/update_command.c
+++ b/shell/update_command.c
@@ -28,6 +28,8 @@
#include <curl/curl.h>
#include <curl/easy.h>
+#include <linux/limits.h>
+
#include "command_private.h"
#include "array_list.h"
#include "bundle_context.h"
@@ -65,7 +67,7 @@ void updateCommand_execute(COMMAND command, char * line, void (*out)(char *), vo
bundleContext_getBundleById(command->bundleContext, id, &bundle);
if (bundle != NULL) {
sub = strtok(NULL, delims);
- char inputFile[MAXNAMLEN];
+ char inputFile[NAME_MAX];
inputFile[0] = '\0';
if (sub != NULL) {
printf("URL: %s\n", sub);
--
1.7.10.4
[RFC] [PATCH v1 4/9] fix compiler warning about implicit declaration
Posted by Ferry Huberts <ma...@hupie.com>.
From: Ferry Huberts <fe...@pelagic.nl>
Signed-off-by: Ferry Huberts <fe...@pelagic.nl>
---
deployment_admin/private/include/miniunz.h | 15 +++++++++++++++
deployment_admin/private/src/deployment_admin.c | 1 +
deployment_admin/private/src/miniunz.c | 2 ++
3 files changed, 18 insertions(+)
create mode 100644 deployment_admin/private/include/miniunz.h
diff --git a/deployment_admin/private/include/miniunz.h b/deployment_admin/private/include/miniunz.h
new file mode 100644
index 0000000..9f92fb5
--- /dev/null
+++ b/deployment_admin/private/include/miniunz.h
@@ -0,0 +1,15 @@
+/*
+ * log.h
+ *
+ * Created on: Jul 13, 2012
+ * Author: Ferry Huberts
+ */
+
+#ifndef MINIUNZ_H_
+#define MINIUNZ_H_
+
+#include "celix_errno.h"
+
+celix_status_t extractBundle(char * bundleName, char * revisionRoot);
+
+#endif /* MINIUNZ_H_ */
diff --git a/deployment_admin/private/src/deployment_admin.c b/deployment_admin/private/src/deployment_admin.c
index 5955247..5065b5f 100644
--- a/deployment_admin/private/src/deployment_admin.c
+++ b/deployment_admin/private/src/deployment_admin.c
@@ -19,6 +19,7 @@
#include "deployment_package.h"
#include "bundle.h"
#include "utils.h"
+#include "miniunz.h"
#include "log.h"
#include "log_store.h"
diff --git a/deployment_admin/private/src/miniunz.c b/deployment_admin/private/src/miniunz.c
index c3980f0..94c1483 100644
--- a/deployment_admin/private/src/miniunz.c
+++ b/deployment_admin/private/src/miniunz.c
@@ -27,6 +27,8 @@
#endif
#endif
+#include "miniunz.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
--
1.7.10.4
[RFC] [PATCH v1 8/9] eclipse: update include paths
Posted by Ferry Huberts <ma...@hupie.com>.
From: Ferry Huberts <fe...@pelagic.nl>
Signed-off-by: Ferry Huberts <fe...@pelagic.nl>
---
.cproject | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.cproject b/.cproject
index 3f35652..95e4568 100644
--- a/.cproject
+++ b/.cproject
@@ -38,11 +38,11 @@
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.base.1155311834" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.base"/>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.macosx.base.387685994" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.macosx.base">
<option id="gnu.c.compiler.option.include.paths.544783026" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
- <listOptionValue builtIn="false" value="/opt/local/include"/>
<listOptionValue builtIn="false" value="/usr/include/apr-1"/>
- <listOptionValue builtIn="false" value="/opt/local/include/CUnit"/>
+ <listOptionValue builtIn="false" value="/usr/include/CUnit"/>
<listOptionValue builtIn="false" value="/usr/include/glib-2.0"/>
<listOptionValue builtIn="false" value="/usr/include/gtk-2.0"/>
+ <listOptionValue builtIn="false" value="/usr/include"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1627566234" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
--
1.7.10.4
[RFC] [PATCH v1 2/9] add forgotten include
Posted by Ferry Huberts <ma...@hupie.com>.
From: Ferry Huberts <fe...@pelagic.nl>
Signed-off-by: Ferry Huberts <fe...@pelagic.nl>
---
.../chapter04-paint-example/simple/public/include/simple_shape.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/examples/osgi-in-action/chapter04-paint-example/simple/public/include/simple_shape.h b/examples/osgi-in-action/chapter04-paint-example/simple/public/include/simple_shape.h
index 8e4be5b..689bdc6 100644
--- a/examples/osgi-in-action/chapter04-paint-example/simple/public/include/simple_shape.h
+++ b/examples/osgi-in-action/chapter04-paint-example/simple/public/include/simple_shape.h
@@ -8,6 +8,8 @@
#ifndef SIMPLE_SHAPE_H_
#define SIMPLE_SHAPE_H_
+#include <gdk/gdk.h>
+
struct simple_shape {
char *icon_path;
char *name;
--
1.7.10.4
[RFC] [PATCH v1 1/9] add some include paths
Posted by Ferry Huberts <ma...@hupie.com>.
From: Ferry Huberts <fe...@pelagic.nl>
Signed-off-by: Ferry Huberts <fe...@pelagic.nl>
---
.cproject | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.cproject b/.cproject
index f92917f..3f35652 100644
--- a/.cproject
+++ b/.cproject
@@ -41,6 +41,8 @@
<listOptionValue builtIn="false" value="/opt/local/include"/>
<listOptionValue builtIn="false" value="/usr/include/apr-1"/>
<listOptionValue builtIn="false" value="/opt/local/include/CUnit"/>
+ <listOptionValue builtIn="false" value="/usr/include/glib-2.0"/>
+ <listOptionValue builtIn="false" value="/usr/include/gtk-2.0"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1627566234" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
--
1.7.10.4
Re: [RFC] [PATCH v1 9/9] use gtk accessor functions
Posted by Ferry Huberts <ma...@hupie.com>.
On 13-07-12 23:35, Ferry Huberts wrote:
> From: Ferry Huberts <fe...@pelagic.nl>
>
> Signed-off-by: Ferry Huberts <fe...@pelagic.nl>
> ---
> .../circle/private/src/circle_shape.c | 6 +++---
> .../paint/private/src/default_shape.c | 2 +-
> .../paint/private/src/paint_frame.c | 19 +++++++++++++------
> .../square/private/src/square_shape.c | 2 +-
> .../triangle/private/src/triangle_shape.c | 2 +-
> 5 files changed, 19 insertions(+), 12 deletions(-)
>
> diff --git a/examples/osgi-in-action/chapter04-paint-example/circle/private/src/circle_shape.c b/examples/osgi-in-action/chapter04-paint-example/circle/private/src/circle_shape.c
> index 96aeed4..2c19bbe 100644
> --- a/examples/osgi-in-action/chapter04-paint-example/circle/private/src/circle_shape.c
> +++ b/examples/osgi-in-action/chapter04-paint-example/circle/private/src/circle_shape.c
> @@ -58,12 +58,12 @@ celix_status_t circleShape_create(BUNDLE_CONTEXT context, SIMPLE_SHAPE *shape) {
> void circleShape_draw(SIMPLE_SHAPE shape, GdkPixmap *pixMap, GtkWidget *widget, gdouble x, gdouble y){
> GdkRectangle update_rect;
> GError *gerror = NULL;
> - gsize rd = 0, wr = 0;
> + gsize rd = 0, wr = 0;// FIXME
this shouldn't have been in the patch
> if (shape->icon_path == NULL) {
> printf("error message: icon path unknown\n");
> } else {
> gchar *gfn = g_locale_to_utf8(shape->icon_path, strlen(shape->icon_path), &rd, &wr, &gerror);
> - GdkPixbuf*curr_pix_buf = gdk_pixbuf_new_from_file(gfn, &gerror);
> + GdkPixbuf*curr_pix_buf = gdk_pixbuf_new_from_file(gfn, &gerror);// FIXME
neither this one
> if(!curr_pix_buf) {
> g_printerr("error message: %s\n", (gchar *) gerror->message);
> }
> @@ -74,7 +74,7 @@ void circleShape_draw(SIMPLE_SHAPE shape, GdkPixmap *pixMap, GtkWidget *widget,
> gdk_pixbuf_render_to_drawable(
> curr_pix_buf,
> pixMap,
> - widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
> + gtk_widget_get_style(widget)->fg_gc[gtk_widget_get_state(widget)],
> 0, 0,
> update_rect.x, update_rect.y,
> update_rect.width,
> diff --git a/examples/osgi-in-action/chapter04-paint-example/paint/private/src/default_shape.c b/examples/osgi-in-action/chapter04-paint-example/paint/private/src/default_shape.c
> index df6684f..28a1efd 100644
> --- a/examples/osgi-in-action/chapter04-paint-example/paint/private/src/default_shape.c
> +++ b/examples/osgi-in-action/chapter04-paint-example/paint/private/src/default_shape.c
> @@ -59,7 +59,7 @@ void defaultShape_draw(SIMPLE_SHAPE shape, GdkPixmap *pixMap, GtkWidget *widget,
> gdk_pixbuf_render_to_drawable(
> curr_pix_buf,
> pixMap,
> - widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
> + gtk_widget_get_style(widget)->fg_gc[gtk_widget_get_state(widget)],
> 0, 0,
> update_rect.x, update_rect.y,
> update_rect.width,
> diff --git a/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c b/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c
> index bf2d49a..550ec8a 100644
> --- a/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c
> +++ b/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c
> @@ -261,18 +261,23 @@ static void paintFrame_destroyWidgets(PAINT_FRAME frame) {
>
> static void paintFrame_configure(GtkWidget *widget, GdkEventConfigure *event, gpointer data) {
> PAINT_FRAME frame = data;
> + GtkAllocation allocation;
> +
> if (frame->pixMap != NULL) {
> gdk_pixmap_unref(frame->pixMap);
> }
>
> - frame->pixMap = gdk_pixmap_new(widget->window, widget->allocation.width, widget->allocation.height, -1);
> + gtk_widget_get_allocation(widget, &allocation);
> + frame->pixMap = gdk_pixmap_new(gtk_widget_get_window(widget), allocation.width, allocation.height, -1);
> paintFrame_redraw(frame, 0);
> }
>
> static void paintFrame_expose(GtkWidget *widget, GdkEventExpose *event, gpointer data) {
> PAINT_FRAME frame = data;
> - gdk_draw_pixmap(widget->window, widget->style->fg_gc[GTK_WIDGET_STATE (widget)], frame->pixMap,
> - event->area.x, event->area.y, event->area.x, event->area.y, event->area.width, event->area.height);
> + gdk_draw_pixmap(gtk_widget_get_window(widget),
> + gtk_widget_get_style(widget)->fg_gc[gtk_widget_get_state(widget)],
> + frame->pixMap, event->area.x, event->area.y, event->area.x,
> + event->area.y, event->area.width, event->area.height);
> }
>
> static void paintFrame_buttonClicked(GtkWidget *button, gpointer data) {
> @@ -297,13 +302,15 @@ static gboolean paintFrame_mousePressed( GtkWidget *widget, GdkEventButton *even
> static celix_status_t paintFrame_redraw(PAINT_FRAME frame, GdkModifierType state) {
> if (frame->pixMap != NULL && frame->showing) {
> GdkRectangle update_rect;
> + GtkAllocation allocation;
>
> update_rect.x = 0;
> update_rect.y = 0;
> - update_rect.width = frame->drawingArea->allocation.width;
> - update_rect.height = frame->drawingArea->allocation.height;
> + gtk_widget_get_allocation(frame->drawingArea, &allocation);
> + update_rect.width = allocation.width;
> + update_rect.height = allocation.height;
> gdk_draw_rectangle (this->pixMap,
> - frame->drawingArea->style->white_gc,
> + gtk_widget_get_style(frame->drawingArea)->white_gc,
> TRUE,
> update_rect.x, update_rect.y,
> update_rect.width, update_rect.height);
> diff --git a/examples/osgi-in-action/chapter04-paint-example/square/private/src/square_shape.c b/examples/osgi-in-action/chapter04-paint-example/square/private/src/square_shape.c
> index ada9506..125c873 100644
> --- a/examples/osgi-in-action/chapter04-paint-example/square/private/src/square_shape.c
> +++ b/examples/osgi-in-action/chapter04-paint-example/square/private/src/square_shape.c
> @@ -60,7 +60,7 @@ void squareShape_draw(SIMPLE_SHAPE shape, GdkPixmap *pixMap, GtkWidget *widget,
> gdk_pixbuf_render_to_drawable(
> curr_pix_buf,
> pixMap,
> - widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
> + gtk_widget_get_style(widget)->fg_gc[gtk_widget_get_state(widget)],
> 0, 0,
> update_rect.x, update_rect.y,
> update_rect.width,
> diff --git a/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/triangle_shape.c b/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/triangle_shape.c
> index de58885..458b0f1 100644
> --- a/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/triangle_shape.c
> +++ b/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/triangle_shape.c
> @@ -60,7 +60,7 @@ void triangleShape_draw(SIMPLE_SHAPE shape, GdkPixmap *pixMap, GtkWidget *widget
> gdk_pixbuf_render_to_drawable(
> curr_pix_buf,
> pixMap,
> - widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
> + gtk_widget_get_style(widget)->fg_gc[gtk_widget_get_state(widget)],
> 0, 0,
> update_rect.x, update_rect.y,
> update_rect.width,
>
--
Ferry Huberts
[RFC] [PATCH v1 9/9] use gtk accessor functions
Posted by Ferry Huberts <ma...@hupie.com>.
From: Ferry Huberts <fe...@pelagic.nl>
Signed-off-by: Ferry Huberts <fe...@pelagic.nl>
---
.../circle/private/src/circle_shape.c | 6 +++---
.../paint/private/src/default_shape.c | 2 +-
.../paint/private/src/paint_frame.c | 19 +++++++++++++------
.../square/private/src/square_shape.c | 2 +-
.../triangle/private/src/triangle_shape.c | 2 +-
5 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/examples/osgi-in-action/chapter04-paint-example/circle/private/src/circle_shape.c b/examples/osgi-in-action/chapter04-paint-example/circle/private/src/circle_shape.c
index 96aeed4..2c19bbe 100644
--- a/examples/osgi-in-action/chapter04-paint-example/circle/private/src/circle_shape.c
+++ b/examples/osgi-in-action/chapter04-paint-example/circle/private/src/circle_shape.c
@@ -58,12 +58,12 @@ celix_status_t circleShape_create(BUNDLE_CONTEXT context, SIMPLE_SHAPE *shape) {
void circleShape_draw(SIMPLE_SHAPE shape, GdkPixmap *pixMap, GtkWidget *widget, gdouble x, gdouble y){
GdkRectangle update_rect;
GError *gerror = NULL;
- gsize rd = 0, wr = 0;
+ gsize rd = 0, wr = 0;// FIXME
if (shape->icon_path == NULL) {
printf("error message: icon path unknown\n");
} else {
gchar *gfn = g_locale_to_utf8(shape->icon_path, strlen(shape->icon_path), &rd, &wr, &gerror);
- GdkPixbuf*curr_pix_buf = gdk_pixbuf_new_from_file(gfn, &gerror);
+ GdkPixbuf*curr_pix_buf = gdk_pixbuf_new_from_file(gfn, &gerror);// FIXME
if(!curr_pix_buf) {
g_printerr("error message: %s\n", (gchar *) gerror->message);
}
@@ -74,7 +74,7 @@ void circleShape_draw(SIMPLE_SHAPE shape, GdkPixmap *pixMap, GtkWidget *widget,
gdk_pixbuf_render_to_drawable(
curr_pix_buf,
pixMap,
- widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+ gtk_widget_get_style(widget)->fg_gc[gtk_widget_get_state(widget)],
0, 0,
update_rect.x, update_rect.y,
update_rect.width,
diff --git a/examples/osgi-in-action/chapter04-paint-example/paint/private/src/default_shape.c b/examples/osgi-in-action/chapter04-paint-example/paint/private/src/default_shape.c
index df6684f..28a1efd 100644
--- a/examples/osgi-in-action/chapter04-paint-example/paint/private/src/default_shape.c
+++ b/examples/osgi-in-action/chapter04-paint-example/paint/private/src/default_shape.c
@@ -59,7 +59,7 @@ void defaultShape_draw(SIMPLE_SHAPE shape, GdkPixmap *pixMap, GtkWidget *widget,
gdk_pixbuf_render_to_drawable(
curr_pix_buf,
pixMap,
- widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+ gtk_widget_get_style(widget)->fg_gc[gtk_widget_get_state(widget)],
0, 0,
update_rect.x, update_rect.y,
update_rect.width,
diff --git a/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c b/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c
index bf2d49a..550ec8a 100644
--- a/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c
+++ b/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c
@@ -261,18 +261,23 @@ static void paintFrame_destroyWidgets(PAINT_FRAME frame) {
static void paintFrame_configure(GtkWidget *widget, GdkEventConfigure *event, gpointer data) {
PAINT_FRAME frame = data;
+ GtkAllocation allocation;
+
if (frame->pixMap != NULL) {
gdk_pixmap_unref(frame->pixMap);
}
- frame->pixMap = gdk_pixmap_new(widget->window, widget->allocation.width, widget->allocation.height, -1);
+ gtk_widget_get_allocation(widget, &allocation);
+ frame->pixMap = gdk_pixmap_new(gtk_widget_get_window(widget), allocation.width, allocation.height, -1);
paintFrame_redraw(frame, 0);
}
static void paintFrame_expose(GtkWidget *widget, GdkEventExpose *event, gpointer data) {
PAINT_FRAME frame = data;
- gdk_draw_pixmap(widget->window, widget->style->fg_gc[GTK_WIDGET_STATE (widget)], frame->pixMap,
- event->area.x, event->area.y, event->area.x, event->area.y, event->area.width, event->area.height);
+ gdk_draw_pixmap(gtk_widget_get_window(widget),
+ gtk_widget_get_style(widget)->fg_gc[gtk_widget_get_state(widget)],
+ frame->pixMap, event->area.x, event->area.y, event->area.x,
+ event->area.y, event->area.width, event->area.height);
}
static void paintFrame_buttonClicked(GtkWidget *button, gpointer data) {
@@ -297,13 +302,15 @@ static gboolean paintFrame_mousePressed( GtkWidget *widget, GdkEventButton *even
static celix_status_t paintFrame_redraw(PAINT_FRAME frame, GdkModifierType state) {
if (frame->pixMap != NULL && frame->showing) {
GdkRectangle update_rect;
+ GtkAllocation allocation;
update_rect.x = 0;
update_rect.y = 0;
- update_rect.width = frame->drawingArea->allocation.width;
- update_rect.height = frame->drawingArea->allocation.height;
+ gtk_widget_get_allocation(frame->drawingArea, &allocation);
+ update_rect.width = allocation.width;
+ update_rect.height = allocation.height;
gdk_draw_rectangle (this->pixMap,
- frame->drawingArea->style->white_gc,
+ gtk_widget_get_style(frame->drawingArea)->white_gc,
TRUE,
update_rect.x, update_rect.y,
update_rect.width, update_rect.height);
diff --git a/examples/osgi-in-action/chapter04-paint-example/square/private/src/square_shape.c b/examples/osgi-in-action/chapter04-paint-example/square/private/src/square_shape.c
index ada9506..125c873 100644
--- a/examples/osgi-in-action/chapter04-paint-example/square/private/src/square_shape.c
+++ b/examples/osgi-in-action/chapter04-paint-example/square/private/src/square_shape.c
@@ -60,7 +60,7 @@ void squareShape_draw(SIMPLE_SHAPE shape, GdkPixmap *pixMap, GtkWidget *widget,
gdk_pixbuf_render_to_drawable(
curr_pix_buf,
pixMap,
- widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+ gtk_widget_get_style(widget)->fg_gc[gtk_widget_get_state(widget)],
0, 0,
update_rect.x, update_rect.y,
update_rect.width,
diff --git a/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/triangle_shape.c b/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/triangle_shape.c
index de58885..458b0f1 100644
--- a/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/triangle_shape.c
+++ b/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/triangle_shape.c
@@ -60,7 +60,7 @@ void triangleShape_draw(SIMPLE_SHAPE shape, GdkPixmap *pixMap, GtkWidget *widget
gdk_pixbuf_render_to_drawable(
curr_pix_buf,
pixMap,
- widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+ gtk_widget_get_style(widget)->fg_gc[gtk_widget_get_state(widget)],
0, 0,
update_rect.x, update_rect.y,
update_rect.width,
--
1.7.10.4
[RFC] [PATCH v1 5/9] hessian: add forgotten include
Posted by Ferry Huberts <ma...@hupie.com>.
From: Ferry Huberts <fe...@pelagic.nl>
Signed-off-by: Ferry Huberts <fe...@pelagic.nl>
---
hessian/source/private/test/test_service_skeleton.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hessian/source/private/test/test_service_skeleton.c b/hessian/source/private/test/test_service_skeleton.c
index 4b6fc2e..f1d7219 100644
--- a/hessian/source/private/test/test_service_skeleton.c
+++ b/hessian/source/private/test/test_service_skeleton.c
@@ -7,6 +7,8 @@
#include "hessian_2.0_in.h"
+#include <stddef.h>
+
void testServiceSkeleton_sayHello(hessian_in_t in);
void testServiceSkeleton_handleData(hessian_in_t in) {
--
1.7.10.4