diff options
author | George Hazan <george.hazan@gmail.com> | 2015-08-13 17:08:34 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-08-13 17:08:34 +0000 |
commit | 1ea84dc56d95ceaf85c036127c5045eba0ad50ee (patch) | |
tree | a8392d1877470f4d7513e3ad853fa843d564a544 /protocols/AimOscar/src/flap.cpp | |
parent | 5c84f735bc4f40d3f2f645d003ef9a08576878d8 (diff) |
massive name conflict resolution
git-svn-id: http://svn.miranda-ng.org/main/trunk@14941 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/AimOscar/src/flap.cpp')
-rw-r--r-- | protocols/AimOscar/src/flap.cpp | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/protocols/AimOscar/src/flap.cpp b/protocols/AimOscar/src/flap.cpp index 96b164fa9c..960034d8a0 100644 --- a/protocols/AimOscar/src/flap.cpp +++ b/protocols/AimOscar/src/flap.cpp @@ -18,23 +18,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "stdafx.h"
-FLAP::FLAP(char* buf,int num_bytes)
+FLAP::FLAP(char* buf, int num_bytes)
{
- if (FLAP_SIZE>num_bytes)
- {
- length_=0;
- }
- else
- {
- length_=_htons((*(unsigned short*)&buf[4]));
- if (FLAP_SIZE+length_>num_bytes)
- {
- length_=0;
- }
- else
- {
- type_=buf[1];
- value_=&buf[FLAP_SIZE];
+ if (FLAP_SIZE > num_bytes)
+ length_ = 0;
+ else {
+ length_ = _htons((*(unsigned short*)&buf[4]));
+ if (FLAP_SIZE + length_ > num_bytes)
+ length_ = 0;
+ else {
+ type_ = buf[1];
+ value_ = &buf[FLAP_SIZE];
}
}
}
@@ -42,17 +36,17 @@ unsigned short FLAP::len() {
return length_;
}
+
unsigned short FLAP::snaclen()
{
- return length_-10;
+ return length_ - 10;
}
+
int FLAP::cmp(unsigned short type)
{
- if (type_==type)
- return 1;
- else
- return 0;
+ return (type_ == type);
}
+
char* FLAP::val()
{
return value_;
|