]> git.pld-linux.org Git - packages/zoneminder.git/blame - zoneminder-build.patch
- more c++ related build fixes
[packages/zoneminder.git] / zoneminder-build.patch
CommitLineData
aa3b9825
JR
1--- ZoneMinder-1.28.0/src/zm_comms.h 2014-10-18 22:23:13.000000000 +0200
2+++ ZoneMinder-1.28.0-cxx/src/zm_comms.h 2018-03-10 23:09:25.399824067 +0100
3@@ -26,6 +26,7 @@
4 #include <netdb.h>
5 #include <errno.h>
6 #include <sys/un.h>
7+#include <sys/uio.h>
8
9 #include <set>
10 #include <vector>
a976cd8d
AM
11--- ZoneMinder-1.24.2/src/zm_utils.cpp.org 2009-07-12 19:45:34.387460575 +0200
12+++ ZoneMinder-1.24.2/src/zm_utils.cpp 2009-07-12 19:46:00.454902859 +0200
13@@ -21,6 +21,7 @@
14 #include "zm_utils.h"
15
16 #include <stdarg.h>
17+#include <stdio.h>
18
19 const std::string stringtf( const char *format, ... )
20 {
5cff13b1
AM
21--- ZoneMinder-1.24.2/scripts/zmfilter.pl.in~ 2009-06-08 11:16:04.000000000 +0200
22+++ ZoneMinder-1.24.2/scripts/zmfilter.pl.in 2011-01-20 11:03:41.575750088 +0100
23@@ -270,7 +270,7 @@
24 my $sql = "select E.Id,E.MonitorId,M.Name as MonitorName,M.DefaultRate,M.DefaultScale,E.Name,E.Cause,E.Notes,E.StartTime,unix_timestamp(E.StartTime) as Time,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived,E.Videoed,E.Uploaded,E.Emailed,E.Messaged,E.Executed from Events as E inner join Monitors as M on M.Id = E.MonitorId where not isnull(E.EndTime)";
25 $db_filter->{Sql} = '';
26
27- if ( @{$filter_expr->{terms}} )
28+ if ( $filter_expr->{terms} and @{$filter_expr->{terms}} )
29 {
30 for ( my $i = 0; $i < @{$filter_expr->{terms}}; $i++ )
31 {
708cf0df
JB
32--- ZoneMinder-1.28.0/src/zm_image.cpp.orig 2014-10-18 22:23:13.000000000 +0200
33+++ ZoneMinder-1.28.0/src/zm_image.cpp 2017-04-14 18:25:49.847052104 +0200
aa3b9825
JR
34@@ -1562,7 +1562,7 @@
35 {
36 uint8_t *psrc = images[j]->buffer+c;
37
38- if ( (unsigned)abs((*psrc)-RGB_VAL(ref_colour,c)) >= RGB_VAL(threshold,c) )
39+ if ( (unsigned)std::abs((int)(*psrc)-(int)RGB_VAL(ref_colour,c)) >= RGB_VAL(threshold,c) )
40 {
41 count++;
42 }
708cf0df
JB
43@@ -1668,7 +1668,7 @@ const Coord Image::centreCoord( const ch
44 line = text+index;
45 line_no++;
46 }
47- int x = (width - (max_line_len * CHAR_WIDTH) ) / 2;
48+ int x = (width - (max_line_len * ZM_CHAR_WIDTH) ) / 2;
49 int y = (height - (line_no * LINE_HEIGHT) ) / 2;
50 return( Coord( x, y ) );
51 }
52@@ -1701,7 +1701,7 @@ void Image::Annotate( const char *p_text
53 while ( (index < text_len) && (line_len = strcspn( line, "\n" )) )
54 {
55
56- unsigned int line_width = line_len * CHAR_WIDTH;
57+ unsigned int line_width = line_len * ZM_CHAR_WIDTH;
58
59 unsigned int lo_line_x = coord.X();
60 unsigned int lo_line_y = coord.Y() + (line_no * LINE_HEIGHT);
61@@ -1732,13 +1732,13 @@ void Image::Annotate( const char *p_text
62 if ( colours == ZM_COLOUR_GRAY8 )
63 {
64 unsigned char *ptr = &buffer[(lo_line_y*width)+lo_line_x];
65- for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < CHAR_HEIGHT; y++, r++, ptr += width )
66+ for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < ZM_CHAR_HEIGHT; y++, r++, ptr += width )
67 {
68 unsigned char *temp_ptr = ptr;
69 for ( unsigned int x = lo_line_x, c = 0; x < hi_line_x && c < line_len; c++ )
70 {
71- int f = fontdata[(line[c] * CHAR_HEIGHT) + r];
72- for ( unsigned int i = 0; i < CHAR_WIDTH && x < hi_line_x; i++, x++, temp_ptr++ )
73+ int f = fontdata[(line[c] * ZM_CHAR_HEIGHT) + r];
74+ for ( unsigned int i = 0; i < ZM_CHAR_WIDTH && x < hi_line_x; i++, x++, temp_ptr++ )
75 {
76 if ( f & (0x80 >> i) )
77 {
78@@ -1758,13 +1758,13 @@ void Image::Annotate( const char *p_text
79 unsigned int wc = width * colours;
80
81 unsigned char *ptr = &buffer[((lo_line_y*width)+lo_line_x)*colours];
82- for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < CHAR_HEIGHT; y++, r++, ptr += wc )
83+ for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < ZM_CHAR_HEIGHT; y++, r++, ptr += wc )
84 {
85 unsigned char *temp_ptr = ptr;
86 for ( unsigned int x = lo_line_x, c = 0; x < hi_line_x && c < line_len; c++ )
87 {
88- int f = fontdata[(line[c] * CHAR_HEIGHT) + r];
89- for ( unsigned int i = 0; i < CHAR_WIDTH && x < hi_line_x; i++, x++, temp_ptr += colours )
90+ int f = fontdata[(line[c] * ZM_CHAR_HEIGHT) + r];
91+ for ( unsigned int i = 0; i < ZM_CHAR_WIDTH && x < hi_line_x; i++, x++, temp_ptr += colours )
92 {
93 if ( f & (0x80 >> i) )
94 {
95@@ -1790,13 +1790,13 @@ void Image::Annotate( const char *p_text
96 unsigned int wc = width * colours;
97
98 uint8_t *ptr = &buffer[((lo_line_y*width)+lo_line_x)<<2];
99- for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < CHAR_HEIGHT; y++, r++, ptr += wc )
100+ for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < ZM_CHAR_HEIGHT; y++, r++, ptr += wc )
101 {
102 Rgb* temp_ptr = (Rgb*)ptr;
103 for ( unsigned int x = lo_line_x, c = 0; x < hi_line_x && c < line_len; c++ )
104 {
105- int f = fontdata[(line[c] * CHAR_HEIGHT) + r];
106- for ( unsigned int i = 0; i < CHAR_WIDTH && x < hi_line_x; i++, x++, temp_ptr++ )
107+ int f = fontdata[(line[c] * ZM_CHAR_HEIGHT) + r];
108+ for ( unsigned int i = 0; i < ZM_CHAR_WIDTH && x < hi_line_x; i++, x++, temp_ptr++ )
109 {
110 if ( f & (0x80 >> i) )
111 {
112--- ZoneMinder-1.28.0/src/zm_image.h.orig 2014-10-18 22:23:13.000000000 +0200
113+++ ZoneMinder-1.28.0/src/zm_image.h 2017-04-14 18:25:49.817050635 +0200
114@@ -122,8 +122,8 @@ protected:
115 }
116
117 public:
118- enum { CHAR_HEIGHT=11, CHAR_WIDTH=6 };
119- enum { LINE_HEIGHT=CHAR_HEIGHT+0 };
120+ enum { ZM_CHAR_HEIGHT=11, ZM_CHAR_WIDTH=6 };
121+ enum { LINE_HEIGHT=ZM_CHAR_HEIGHT+0 };
122
123 protected:
124 static bool initialised;
125--- ZoneMinder-1.28.0/src/zm_rtp_ctrl.cpp.orig 2014-10-18 22:23:13.000000000 +0200
126+++ ZoneMinder-1.28.0/src/zm_rtp_ctrl.cpp 2017-04-14 20:21:02.697466199 +0200
127@@ -220,7 +220,7 @@ int RtpCtrlThread::generateBye( const un
128 {
129 RtcpPacket *rtcpPacket = (RtcpPacket *)packet;
130
131- int byteLen = sizeof(rtcpPacket->header)+sizeof(rtcpPacket->body.bye)+sizeof(rtcpPacket->body.bye.srcN[0]);
132+ int byteLen = sizeof(rtcpPacket->header)+sizeof(rtcpPacket->body.bye);
133 int wordLen = ((byteLen-1)/sizeof(uint32_t))+1;
134
135 rtcpPacket->header.version = RTP_VERSION;
136--- ZoneMinder-1.28.0/src/zm_rtp_ctrl.h.orig 2014-10-18 22:23:13.000000000 +0200
137+++ ZoneMinder-1.28.0/src/zm_rtp_ctrl.h 2017-04-14 20:18:37.863663657 +0200
138@@ -125,7 +125,7 @@ private:
139 // BYE
140 struct Bye
141 {
142- uint32_t srcN[]; // list of sources
143+ uint32_t srcN[1]; // list of sources
144 // can't express trailing text for reason (what does this mean? it's not even english!)
145 } bye;
146 } body;
This page took 0.157674 seconds and 4 git commands to generate.