[Forensics-changes] [yara] 101/160: Get rid of designated initializations as MS Visual C++ don't support it

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:29:22 UTC 2017


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag v3.4.0
in repository yara.

commit f7353d8c217a52d796143487254edfc587219695
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Tue May 5 11:56:34 2015 +0200

    Get rid of designated initializations as MS Visual C++ don't support it
---
 libyara/rules.c           | 16 ++++++++--------
 yara-python/yara-python.c | 16 ++++++++--------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/libyara/rules.c b/libyara/rules.c
index 1ebec41..b51d9cb 100644
--- a/libyara/rules.c
+++ b/libyara/rules.c
@@ -675,10 +675,10 @@ YR_API int yr_rules_load(
   if (fh == NULL)
     return ERROR_COULD_NOT_OPEN_FILE;
 
-  YR_STREAM stream = {
-    .user_data = fh,
-    .read = (YR_STREAM_READ_FUNC) fread
-  };
+  YR_STREAM stream;
+
+  stream.user_data = fh;
+  stream.read = (YR_STREAM_READ_FUNC) fread;
 
   int result = yr_rules_load_stream(&stream, rules);
 
@@ -705,10 +705,10 @@ YR_API int yr_rules_save(
   if (fh == NULL)
     return ERROR_COULD_NOT_OPEN_FILE;
 
-  YR_STREAM stream = {
-    .user_data = fh,
-    .write = (YR_STREAM_WRITE_FUNC) fwrite,
-  };
+  YR_STREAM stream;
+
+  stream.user_data = fh;
+  stream.write = (YR_STREAM_WRITE_FUNC) fwrite;
 
   int result = yr_rules_save_stream(rules, &stream);
 
diff --git a/yara-python/yara-python.c b/yara-python/yara-python.c
index 1e9db3c..5378944 100644
--- a/yara-python/yara-python.c
+++ b/yara-python/yara-python.c
@@ -1248,10 +1248,10 @@ static PyObject * Rules_save(
   }
   else if (PyObject_HasAttrString(param, "write"))
   {
-    YR_STREAM stream = {
-      .user_data = param,
-      .write = flo_write
-    };
+    YR_STREAM stream;
+
+    stream.user_data = param;
+    stream.write = flo_write;
 
     Py_BEGIN_ALLOW_THREADS;
     error = yr_rules_save_stream(rules->rules, &stream);
@@ -1682,10 +1682,10 @@ static PyObject * yara_load(
   }
   else if (PyObject_HasAttrString(param, "read"))
   {
-    YR_STREAM stream = {
-      .user_data = param,
-      .read = flo_read
-    };
+    YR_STREAM stream;
+
+    stream.user_data = param;
+    stream.read = flo_read;
 
     Py_BEGIN_ALLOW_THREADS;
     error = yr_rules_load_stream(&stream, &rules->rules);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list