[Solved] Does not compile plus PHP standards in classic skin

Forum for questions and support relating to the 1.25.x releases only.
Locked
User avatar
lyallp
Posts: 137
Joined: Fri Nov 26, 2010 2:36 am
Location: Adelaide, Australia

[Solved] Does not compile plus PHP standards in classic skin

Post by lyallp »

As at 31-Dec-2012, using the zoneminder ebuild located in the overlay ''zugaina'', zoneminder does not compile on 64 bit (amd64) Gentoo with kernel 3.6.11 and GCC 4.6.3 p1.8

A solution was suggested that [http://www.linuxquestions.org/questions ... nt-939357/ in this forum post], however, I found that the patches, as supplied, did not work.

Suggestions welcomed.
Last edited by lyallp on Tue Jan 01, 2013 5:25 am, edited 2 times in total.
...Lyall
chriswiggins
Posts: 18
Joined: Fri Sep 28, 2012 2:52 am

Re: Does not compile with GCC 4.6

Post by chriswiggins »

Can you be a bit more informative? Please post some output from the compilation and your configure options etc (if you can pull it out of the ebuild?)
User avatar
lyallp
Posts: 137
Joined: Fri Nov 26, 2010 2:36 am
Location: Adelaide, Australia

Re: Does not compile with GCC 4.6

Post by lyallp »

I can do more than that.

:)

The following patch, when integrated into the 1.25.0 zugaina www-misc/zoneminder ebuild, fixes the problem.

Code: Select all

--- src/zm_local_camera.cpp~ 2012-09-11 12:41:09.711153916 +0100
+++ src/zm_local_camera.cpp 2012-09-11 12:41:09.725153941 +0100
@@ -1048,7 +1048,8 @@
         Debug( 3, "Terminating video stream" );
         //enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-        enum v4l2_buf_type type = v4l2_data.fmt.type;
+        // enum v4l2_buf_type type = v4l2_data.fmt.type;
+        enum v4l2_buf_type type = (v4l2_buf_type)v4l2_data.fmt.type;
         if ( vidioctl( vid_fd, VIDIOC_STREAMOFF, &type ) < 0 )
             Error( "Failed to stop capture stream: %s", strerror(errno) );
     {
 	Debug( 3, "Terminating video stream" );
@@ -1931,7 +1932,8 @@
         Debug( 3, "Starting video stream" );
         //enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-        enum v4l2_buf_type type = v4l2_data.fmt.type;
+        // enum v4l2_buf_type type = v4l2_data.fmt.type;
+        enum v4l2_buf_type type = (v4l2_buf_type)v4l2_data.fmt.type;
         if ( vidioctl( vid_fd, VIDIOC_STREAMON, &type ) < 0 )
             Fatal( "Failed to start capture stream: %s", strerror(errno) );
     }
...Lyall
User avatar
lyallp
Posts: 137
Joined: Fri Nov 26, 2010 2:36 am
Location: Adelaide, Australia

Re: Does not compile with GCC 4.6

Post by lyallp »

Here is another patch to correct a warning from the classic skin.
I have not checked to see if something similar needs to be done to the other skins.

Code: Select all

--- web/skins/classic/views/event.php~	2010-11-04 02:19:47.000000000 +1030
+++ web/skins/classic/views/event.php	2013-01-01 16:06:43.000000000 +1030
@@ -59,8 +59,13 @@
     $replayMode = validHtmlStr($_REQUEST['replayMode']);
 if ( isset( $_COOKIE['replayMode']) && preg_match('#^[a-z]+$#', $_COOKIE['replayMode']) )
     $replayMode = validHtmlStr($_COOKIE['replayMode']);
- else
-     $replayMode = array_shift( array_keys( $replayModes ) );
+ else {
+     $holdingVar = array_keys( $replayModes );
+     $replayMode = array_shift( $holdingVar );
+     // $replayMode = array_shift( array_keys( $replayModes ) );
+     unset( $holdingVar );
+      }
+
 
 parseSort();
 parseFilter( $_REQUEST['filter'] );
...Lyall
Locked