<p>osmith has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/12278">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">osmo-trx.cpp: move comma_delimited_to_vector() to Utils.cpp<br><br>Make the "opt" argument const. This function will also be used by<br>LMSDevice.cpp in a follow-up commit.<br><br>Related: OS#3654<br>Change-Id: If3f0f682ca453c2b0a06175ec9626567932cfce6<br>---<br>M CommonLibs/Makefile.am<br>A CommonLibs/Utils.cpp<br>A CommonLibs/Utils.h<br>M Transceiver52M/osmo-trx.cpp<br>4 files changed, 63 insertions(+), 15 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/78/12278/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am</span><br><span>index 9fabcf1..83bd0c0 100644</span><br><span>--- a/CommonLibs/Makefile.am</span><br><span>+++ b/CommonLibs/Makefile.am</span><br><span>@@ -34,6 +34,7 @@</span><br><span>     Threads.cpp \</span><br><span>        Timeval.cpp \</span><br><span>        Logger.cpp \</span><br><span style="color: hsl(120, 100%, 40%);">+  Utils.cpp \</span><br><span>  trx_vty.c \</span><br><span>  debug.c</span><br><span> libcommon_la_LIBADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS)</span><br><span>@@ -48,6 +49,7 @@</span><br><span>      Timeval.h \</span><br><span>  Vector.h \</span><br><span>   Logger.h \</span><br><span style="color: hsl(120, 100%, 40%);">+    Utils.h \</span><br><span>    trx_vty.h \</span><br><span>  debug.h \</span><br><span>    osmo_signal.h \</span><br><span>diff --git a/CommonLibs/Utils.cpp b/CommonLibs/Utils.cpp</span><br><span>new file mode 100644</span><br><span>index 0000000..6cd4f84</span><br><span>--- /dev/null</span><br><span>+++ b/CommonLibs/Utils.cpp</span><br><span>@@ -0,0 +1,36 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright 2018 sysmocom - s.f.m.c. GmbH</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This library is free software; you can redistribute it and/or</span><br><span style="color: hsl(120, 100%, 40%);">+ * modify it under the terms of the GNU Lesser General Public</span><br><span style="color: hsl(120, 100%, 40%);">+ * License as published by the Free Software Foundation; either</span><br><span style="color: hsl(120, 100%, 40%);">+ * version 2.1 of the License, or (at your option) any later version.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This library is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span><br><span style="color: hsl(120, 100%, 40%);">+ * Lesser General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * You should have received a copy of the GNU Lesser General Public</span><br><span style="color: hsl(120, 100%, 40%);">+ * License along with this library; if not, write to the Free Software</span><br><span style="color: hsl(120, 100%, 40%);">+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <vector></span><br><span style="color: hsl(120, 100%, 40%);">+#include <string></span><br><span style="color: hsl(120, 100%, 40%);">+#include <sstream></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+std::vector<std::string> comma_delimited_to_vector(const char* opt)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     std::string str = std::string(opt);</span><br><span style="color: hsl(120, 100%, 40%);">+   std::vector<std::string> result;</span><br><span style="color: hsl(120, 100%, 40%);">+        std::stringstream ss(str);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  while( ss.good() )</span><br><span style="color: hsl(120, 100%, 40%);">+    {</span><br><span style="color: hsl(120, 100%, 40%);">+         std::string substr;</span><br><span style="color: hsl(120, 100%, 40%);">+           getline(ss, substr, ',');</span><br><span style="color: hsl(120, 100%, 40%);">+     result.push_back(substr);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+     return result;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span>diff --git a/CommonLibs/Utils.h b/CommonLibs/Utils.h</span><br><span>new file mode 100644</span><br><span>index 0000000..4f0fbc0</span><br><span>--- /dev/null</span><br><span>+++ b/CommonLibs/Utils.h</span><br><span>@@ -0,0 +1,24 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright 2018 sysmocom - s.f.m.c. GmbH</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This library is free software; you can redistribute it and/or</span><br><span style="color: hsl(120, 100%, 40%);">+ * modify it under the terms of the GNU Lesser General Public</span><br><span style="color: hsl(120, 100%, 40%);">+ * License as published by the Free Software Foundation; either</span><br><span style="color: hsl(120, 100%, 40%);">+ * version 2.1 of the License, or (at your option) any later version.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This library is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span><br><span style="color: hsl(120, 100%, 40%);">+ * Lesser General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * You should have received a copy of the GNU Lesser General Public</span><br><span style="color: hsl(120, 100%, 40%);">+ * License along with this library; if not, write to the Free Software</span><br><span style="color: hsl(120, 100%, 40%);">+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#pragma once</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <vector></span><br><span style="color: hsl(120, 100%, 40%);">+#include <string></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+std::vector<std::string> comma_delimited_to_vector(const char* opt);</span><br><span>diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp</span><br><span>index 2b69da4..0e63020 100644</span><br><span>--- a/Transceiver52M/osmo-trx.cpp</span><br><span>+++ b/Transceiver52M/osmo-trx.cpp</span><br><span>@@ -22,6 +22,7 @@</span><br><span> </span><br><span> #include "Transceiver.h"</span><br><span> #include "radioDevice.h"</span><br><span style="color: hsl(120, 100%, 40%);">+#include "Utils.h"</span><br><span> </span><br><span> #include <time.h></span><br><span> #include <signal.h></span><br><span>@@ -194,21 +195,6 @@</span><br><span>      osmo_init_ignore_signals();</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static std::vector<std::string> comma_delimited_to_vector(char* opt)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- std::string str = std::string(opt);</span><br><span style="color: hsl(0, 100%, 40%);">-     std::vector<std::string> result;</span><br><span style="color: hsl(0, 100%, 40%);">-  std::stringstream ss(str);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-      while( ss.good() )</span><br><span style="color: hsl(0, 100%, 40%);">-      {</span><br><span style="color: hsl(0, 100%, 40%);">-           std::string substr;</span><br><span style="color: hsl(0, 100%, 40%);">-     getline(ss, substr, ',');</span><br><span style="color: hsl(0, 100%, 40%);">-       result.push_back(substr);</span><br><span style="color: hsl(0, 100%, 40%);">-   }</span><br><span style="color: hsl(0, 100%, 40%);">-       return result;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> static void print_help()</span><br><span> {</span><br><span>     fprintf(stdout, "Options:\n"</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12278">change 12278</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/12278"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-trx </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: If3f0f682ca453c2b0a06175ec9626567932cfce6 </div>
<div style="display:none"> Gerrit-Change-Number: 12278 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>