Browse Source

Fix a few formatting issues

Fixed a few files that went over 80 columns, mostly just a nitpack on my
part.

libobs/obs-nix.c had a rather bad case of leading whitespace.

Also, fixed the x86 obs-studio project files so that it would properly
output to the right directory.  It couldn't find libobs.lib because
obs-studio's project settings had it outputting to a different place
than the rest of the projects.
jp9000 11 years ago
parent
commit
9f1249326b
4 changed files with 34 additions and 30 deletions
  1. 10 5
      libobs/obs-nix.c
  2. 1 2
      obs/platform-windows.cpp
  3. 21 17
      obs/platform-x11.cpp
  4. 2 6
      vs/2013/obs-studio/obs-studio.vcxproj

+ 10 - 5
libobs/obs-nix.c

@@ -22,7 +22,8 @@
 #include "util/dstr.h"
 #include "util/dstr.h"
 #include "obs.h"
 #include "obs.h"
 
 
-static inline bool check_path(const char* data, const char *path, struct dstr * output)
+static inline bool check_path(const char* data, const char *path,
+		struct dstr * output)
 {
 {
 	dstr_copy(output, path);
 	dstr_copy(output, path);
 	dstr_cat(output, data);
 	dstr_cat(output, data);
@@ -32,7 +33,8 @@ static inline bool check_path(const char* data, const char *path, struct dstr *
 	return access(output->array, R_OK) == 0;
 	return access(output->array, R_OK) == 0;
 }
 }
 
 
-static inline bool check_lib_path(const char* data, const char *path, struct dstr *output)
+static inline bool check_lib_path(const char* data, const char *path,
+		struct dstr *output)
 {
 {
 	bool result = false;
 	bool result = false;
 	struct dstr tmp;
 	struct dstr tmp;
@@ -59,7 +61,8 @@ char *find_plugin(const char *plugin)
 	if (check_lib_path(plugin, "obs-plugins/", &output))
 	if (check_lib_path(plugin, "obs-plugins/", &output))
 		return output.array;
 		return output.array;
 
 
-	if (check_lib_path(plugin, OBS_INSTALL_PREFIX "lib/obs-plugins", &output))
+	if (check_lib_path(plugin, OBS_INSTALL_PREFIX "lib/obs-plugins",
+				&output))
 		return output.array;
 		return output.array;
 
 
 	dstr_free(&output);
 	dstr_free(&output);
@@ -78,7 +81,8 @@ char *find_libobs_data_file(const char *file)
 	if (check_path(file, OBS_DATA_PATH "/libobs/", &output))
 	if (check_path(file, OBS_DATA_PATH "/libobs/", &output))
 		return output.array;
 		return output.array;
 
 
-	if (check_path(file, OBS_INSTALL_PREFIX OBS_DATA_PATH "/libobs/", &output))
+	if (check_path(file, OBS_INSTALL_PREFIX OBS_DATA_PATH "/libobs/",
+				&output))
 		return output.array;
 		return output.array;
 
 
 	dstr_free(&output);
 	dstr_free(&output);
@@ -97,7 +101,8 @@ char *obs_find_plugin_file(const char *file)
     if (check_path(file, OBS_DATA_PATH "/obs-plugins/", &output))
     if (check_path(file, OBS_DATA_PATH "/obs-plugins/", &output))
         return output.array;
         return output.array;
 
 
-    if (check_path(file, OBS_INSTALL_PREFIX OBS_DATA_PATH "/obs-plugins/", &output))
+    if (check_path(file, OBS_INSTALL_PREFIX OBS_DATA_PATH "/obs-plugins/",
+			    &output))
         return output.array;
         return output.array;
 
 
     dstr_free(&output);
     dstr_free(&output);

+ 1 - 2
obs/platform-windows.cpp

@@ -27,7 +27,7 @@ using namespace std;
 bool GetDataFilePath(const char *data, string &output)
 bool GetDataFilePath(const char *data, string &output)
 {
 {
 	stringstream str;
 	stringstream str;
-    str << OBS_DATA_PATH "/obs-studio/" << data;
+	str << OBS_DATA_PATH "/obs-studio/" << data;
 	output = str.str();
 	output = str.str();
 	return os_file_exists(output.c_str());
 	return os_file_exists(output.c_str());
 }
 }
@@ -55,4 +55,3 @@ bool InitApplicationBundle()
 {
 {
 	return true;
 	return true;
 }
 }
-

+ 21 - 17
obs/platform-x11.cpp

@@ -15,9 +15,11 @@
     You should have received a copy of the GNU General Public License
     You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
 ******************************************************************************/
+
 /* Here we use xinerama to fetch data about monitor geometry
 /* Here we use xinerama to fetch data about monitor geometry
  * Even if there are not multiple monitors, this should still work. 
  * Even if there are not multiple monitors, this should still work. 
  */
  */
+
 #include <X11/Xlib.h>
 #include <X11/Xlib.h>
 #include <X11/extensions/Xinerama.h>
 #include <X11/extensions/Xinerama.h>
 #include <unistd.h>
 #include <unistd.h>
@@ -26,17 +28,20 @@
 #include "platform.hpp"
 #include "platform.hpp"
 using namespace std;
 using namespace std;
 
 
-static inline bool check_path(const char* data, const char *path, string &output)
+static inline bool check_path(const char* data, const char *path,
+		string &output)
 {
 {
 	ostringstream str;
 	ostringstream str;
 	str << path << data;
 	str << path << data;
 	output = str.str();
 	output = str.str();
-		
+
 	printf("Attempted path: %s\n", output.c_str());
 	printf("Attempted path: %s\n", output.c_str());
-		
+
 	return (access(output.c_str(), R_OK) == 0);
 	return (access(output.c_str(), R_OK) == 0);
 }
 }
 
 
+#define INSTALL_DATA_PATH OBS_INSTALL_PREFIX "/" OBS_DATA_PATH "/obs-studio/"
+
 bool GetDataFilePath(const char *data, string &output)
 bool GetDataFilePath(const char *data, string &output)
 {
 {
 	char *data_path = getenv("OBS_DATA_PATH");
 	char *data_path = getenv("OBS_DATA_PATH");
@@ -44,13 +49,12 @@ bool GetDataFilePath(const char *data, string &output)
 		if (check_path(data, data_path, output))
 		if (check_path(data, data_path, output))
 			return true;
 			return true;
 	}
 	}
-	
+
 	if (check_path(data, OBS_DATA_PATH "/obs-studio/", output))
 	if (check_path(data, OBS_DATA_PATH "/obs-studio/", output))
 		return true;
 		return true;
-	
-	if (check_path(data, OBS_INSTALL_PREFIX "/" OBS_DATA_PATH "/obs-studio/", output))
+	if (check_path(data, INSTALL_DATA_PATH, output))
 		return true;
 		return true;
-	
+
 	return false;
 	return false;
 }
 }
 
 
@@ -60,26 +64,27 @@ void GetMonitors(vector<MonitorInfo> &monitors)
 	XineramaScreenInfo *screens;
 	XineramaScreenInfo *screens;
 	int event_code = 0, error_code = 0;
 	int event_code = 0, error_code = 0;
 	Display* display = XOpenDisplay(NULL);
 	Display* display = XOpenDisplay(NULL);
-	
+
 	if (!XineramaQueryExtension(display, &event_code, &error_code)) {
 	if (!XineramaQueryExtension(display, &event_code, &error_code)) {
-		printf("Xinerama extension unavailable. We don't handle this yet.\n");
+		printf("Xinerama extension unavailable. We don't handle this "
+		       "yet.\n");
 		return;
 		return;
 	}
 	}
-	
+
 	/* Do I need to make a call to XineramaQueryVersion...? */
 	/* Do I need to make a call to XineramaQueryVersion...? */
-	
+
 	screens = XineramaQueryScreens(display, &num_screens);
 	screens = XineramaQueryScreens(display, &num_screens);
-	
+
 	if (num_screens == 0 || !screens) { 
 	if (num_screens == 0 || !screens) { 
 		printf("Xinerama isn't active on this screen.\n");
 		printf("Xinerama isn't active on this screen.\n");
 		return;
 		return;
 	}
 	}
-	
+
 	monitors.clear();
 	monitors.clear();
-	
+
 	do {
 	do {
 		--num_screens;
 		--num_screens;
-		
+
 		monitors.emplace_back(
 		monitors.emplace_back(
 			screens[num_screens].x_org, 
 			screens[num_screens].x_org, 
 			screens[num_screens].y_org,
 			screens[num_screens].y_org,
@@ -87,7 +92,7 @@ void GetMonitors(vector<MonitorInfo> &monitors)
 			screens[num_screens].height
 			screens[num_screens].height
                 );
                 );
 	} while (num_screens > 0);
 	} while (num_screens > 0);
-	
+
 	XCloseDisplay(display);
 	XCloseDisplay(display);
 }
 }
 
 
@@ -95,4 +100,3 @@ bool InitApplicationBundle()
 {
 {
 	return true;
 	return true;
 }
 }
-

+ 2 - 6
vs/2013/obs-studio/obs-studio.vcxproj

@@ -341,15 +341,11 @@
   <PropertyGroup>
   <PropertyGroup>
     <_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
     <_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
   </PropertyGroup>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
     <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
   </PropertyGroup>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
     <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
   </PropertyGroup>
   </PropertyGroup>