Change type in message_action and message_media from int to unsigned.

This commit is contained in:
Thomas Wentzel 2014-03-06 22:07:04 +01:00
parent 6c2392053f
commit 49f1321f77
2 changed files with 20 additions and 20 deletions

View File

@ -722,9 +722,9 @@ void interpreter (char *line UU) {
RET; RET;
} }
struct message *M = message_get (num); struct message *M = message_get (num);
if (M && !M->service && M->media.type == (int)CODE_message_media_photo) { if (M && !M->service && M->media.type == CODE_message_media_photo) {
do_load_photo (&M->media.photo, 1); do_load_photo (&M->media.photo, 1);
} else if (M && !M->service && M->media.type == (int)CODE_decrypted_message_media_photo) { } else if (M && !M->service && M->media.type == CODE_decrypted_message_media_photo) {
do_load_encr_video (&M->media.encr_video, 1); // this is not a bug. do_load_encr_video (&M->media.encr_video, 1); // this is not a bug.
} else { } else {
printf ("Bad msg id\n"); printf ("Bad msg id\n");
@ -737,9 +737,9 @@ void interpreter (char *line UU) {
RET; RET;
} }
struct message *M = message_get (num); struct message *M = message_get (num);
if (M && !M->service && M->media.type == (int)CODE_message_media_photo) { if (M && !M->service && M->media.type == CODE_message_media_photo) {
do_load_photo (&M->media.photo, 2); do_load_photo (&M->media.photo, 2);
} else if (M && !M->service && M->media.type == (int)CODE_decrypted_message_media_photo) { } else if (M && !M->service && M->media.type == CODE_decrypted_message_media_photo) {
do_load_encr_video (&M->media.encr_video, 2); // this is not a bug. do_load_encr_video (&M->media.encr_video, 2); // this is not a bug.
} else { } else {
printf ("Bad msg id\n"); printf ("Bad msg id\n");
@ -752,7 +752,7 @@ void interpreter (char *line UU) {
RET; RET;
} }
struct message *M = message_get (num); struct message *M = message_get (num);
if (M && !M->service && M->media.type == (int)CODE_message_media_video) { if (M && !M->service && M->media.type == CODE_message_media_video) {
do_load_video_thumb (&M->media.video, 1); do_load_video_thumb (&M->media.video, 1);
} else { } else {
printf ("Bad msg id\n"); printf ("Bad msg id\n");
@ -765,7 +765,7 @@ void interpreter (char *line UU) {
RET; RET;
} }
struct message *M = message_get (num); struct message *M = message_get (num);
if (M && !M->service && M->media.type == (int)CODE_message_media_video) { if (M && !M->service && M->media.type == CODE_message_media_video) {
do_load_video_thumb (&M->media.video, 2); do_load_video_thumb (&M->media.video, 2);
} else { } else {
printf ("Bad msg id\n"); printf ("Bad msg id\n");
@ -778,9 +778,9 @@ void interpreter (char *line UU) {
RET; RET;
} }
struct message *M = message_get (num); struct message *M = message_get (num);
if (M && !M->service && M->media.type == (int)CODE_message_media_video) { if (M && !M->service && M->media.type == CODE_message_media_video) {
do_load_video (&M->media.video, 1); do_load_video (&M->media.video, 1);
} else if (M && !M->service && M->media.type == (int)CODE_decrypted_message_media_video) { } else if (M && !M->service && M->media.type == CODE_decrypted_message_media_video) {
do_load_encr_video (&M->media.encr_video, 1); do_load_encr_video (&M->media.encr_video, 1);
} else { } else {
printf ("Bad msg id\n"); printf ("Bad msg id\n");
@ -793,9 +793,9 @@ void interpreter (char *line UU) {
RET; RET;
} }
struct message *M = message_get (num); struct message *M = message_get (num);
if (M && !M->service && M->media.type == (int)CODE_message_media_video) { if (M && !M->service && M->media.type == CODE_message_media_video) {
do_load_video (&M->media.video, 2); do_load_video (&M->media.video, 2);
} else if (M && !M->service && M->media.type == (int)CODE_decrypted_message_media_video) { } else if (M && !M->service && M->media.type == CODE_decrypted_message_media_video) {
do_load_encr_video (&M->media.encr_video, 2); do_load_encr_video (&M->media.encr_video, 2);
} else { } else {
printf ("Bad msg id\n"); printf ("Bad msg id\n");
@ -991,9 +991,9 @@ void interpreter (char *line UU) {
RET; RET;
} }
struct message *M = message_get (num); struct message *M = message_get (num);
if (M && !M->service && M->media.type == (int)CODE_message_media_audio) { if (M && !M->service && M->media.type == CODE_message_media_audio) {
do_load_audio (&M->media.video, 1); do_load_audio (&M->media.video, 1);
} else if (M && !M->service && M->media.type == (int)CODE_decrypted_message_media_audio) { } else if (M && !M->service && M->media.type == CODE_decrypted_message_media_audio) {
do_load_encr_video (&M->media.encr_video, 1); do_load_encr_video (&M->media.encr_video, 1);
} else { } else {
printf ("Bad msg id\n"); printf ("Bad msg id\n");
@ -1006,9 +1006,9 @@ void interpreter (char *line UU) {
RET; RET;
} }
struct message *M = message_get (num); struct message *M = message_get (num);
if (M && !M->service && M->media.type == (int)CODE_message_media_audio) { if (M && !M->service && M->media.type == CODE_message_media_audio) {
do_load_audio (&M->media.video, 2); do_load_audio (&M->media.video, 2);
} else if (M && !M->service && M->media.type == (int)CODE_decrypted_message_media_audio) { } else if (M && !M->service && M->media.type == CODE_decrypted_message_media_audio) {
do_load_encr_video (&M->media.encr_video, 2); do_load_encr_video (&M->media.encr_video, 2);
} else { } else {
printf ("Bad msg id\n"); printf ("Bad msg id\n");
@ -1047,9 +1047,9 @@ void interpreter (char *line UU) {
RET; RET;
} }
struct message *M = message_get (num); struct message *M = message_get (num);
if (M && !M->service && M->media.type == (int)CODE_message_media_document) { if (M && !M->service && M->media.type == CODE_message_media_document) {
do_load_document (&M->media.document, 1); do_load_document (&M->media.document, 1);
} else if (M && !M->service && M->media.type == (int)CODE_decrypted_message_media_document) { } else if (M && !M->service && M->media.type == CODE_decrypted_message_media_document) {
do_load_encr_video (&M->media.encr_video, 1); do_load_encr_video (&M->media.encr_video, 1);
} else { } else {
printf ("Bad msg id\n"); printf ("Bad msg id\n");
@ -1062,9 +1062,9 @@ void interpreter (char *line UU) {
RET; RET;
} }
struct message *M = message_get (num); struct message *M = message_get (num);
if (M && !M->service && M->media.type == (int)CODE_message_media_document) { if (M && !M->service && M->media.type == CODE_message_media_document) {
do_load_document (&M->media.document, 2); do_load_document (&M->media.document, 2);
} else if (M && !M->service && M->media.type == (int)CODE_decrypted_message_media_document) { } else if (M && !M->service && M->media.type == CODE_decrypted_message_media_document) {
do_load_encr_video (&M->media.encr_video, 2); do_load_encr_video (&M->media.encr_video, 2);
} else { } else {
printf ("Bad msg id\n"); printf ("Bad msg id\n");

View File

@ -264,7 +264,7 @@ struct document {
}; };
struct message_action { struct message_action {
int type; unsigned type;
union { union {
struct { struct {
char *title; char *title;
@ -279,7 +279,7 @@ struct message_action {
}; };
struct message_media { struct message_media {
int type; unsigned type;
union { union {
struct photo photo; struct photo photo;
struct video video; struct video video;