qulogic/pidgin

Change #warning to #pragma message

8 months ago, Elliott Sales de Andrade
0459fca48457
Parents 11da504434f2
Children 6e536023f78f
Change #warning to #pragma message

The former is not supported by MSVC, while the latter is.

Testing Done:
Compiled on gcc and MSVC.
The clang docs say they support it as well, but I did not explicitly check.

Reviewed at https://reviews.imfreedom.org/r/2737/
--- a/libpurple/plugins.c Thu Oct 26 22:45:14 2023 -0500
+++ b/libpurple/plugins.c Thu Oct 26 22:51:00 2023 -0500
@@ -256,7 +256,7 @@
GSList *
purple_plugin_get_dependent_plugins(G_GNUC_UNUSED PurplePlugin *plugin)
{
-#warning TODO: Implement this when GPlugin can return dependent plugins.
+#pragma message("TODO: Implement this when GPlugin can return dependent plugins.")
return NULL;
}
--- a/libpurple/protocols/bonjour/bonjour_ft.c Thu Oct 26 22:45:14 2023 -0500
+++ b/libpurple/protocols/bonjour/bonjour_ft.c Thu Oct 26 22:51:00 2023 -0500
@@ -954,7 +954,7 @@
purple_xfer_set_local_port(xfer, port);
- # warning Need to figure out how to get the local ip addresses
+ #pragma message("Need to figure out how to get the local ip addresses")
local_ips = NULL;
port_str = g_strdup_printf("%hu", port);
--- a/pidgin/pidginaccounteditor.c Thu Oct 26 22:45:14 2023 -0500
+++ b/pidgin/pidginaccounteditor.c Thu Oct 26 22:51:00 2023 -0500
@@ -818,12 +818,12 @@
if(bvalue) {
if(GDK_IS_PIXBUF(editor->avatar_pixbuf)) {
- # warning implement this when buddy icons do not suck so bad.
+ #pragma message("implement this when buddy icons do not suck so bad.")
} else {
purple_buddy_icons_set_account_icon(editor->account, NULL, 0);
}
} else {
- # warning set the global buddy icon when buddy icons do not suck so bad.
+ #pragma message("set the global buddy icon when buddy icons do not suck so bad.")
}
purple_account_thaw_notify_settings(editor->account);
--- a/pidgin/pidginaccountmanagerrow.c Thu Oct 26 22:45:14 2023 -0500
+++ b/pidgin/pidginaccountmanagerrow.c Thu Oct 26 22:51:00 2023 -0500
@@ -51,7 +51,7 @@
pidgin_account_manager_row_refresh_buddy_icon(PidginAccountManagerRow *row) {
PurpleImage *image = NULL;
-#warning FIX call this in the right place when buddy icons are better and can autorefresh
+#pragma message("FIX call this in the right place when buddy icons are better and can autorefresh")
if(!PURPLE_IS_ACCOUNT(row->account)) {
return;
}
--- a/pidgin/pidgincolor.c Thu Oct 26 22:45:14 2023 -0500
+++ b/pidgin/pidgincolor.c Thu Oct 26 22:51:00 2023 -0500
@@ -27,38 +27,38 @@
*****************************************************************************/
void
pidgin_color_calculate_for_text(const gchar *text, GdkRGBA *color) {
- GdkRGBA background;
- GChecksum *checksum = NULL;
- guchar digest[20];
- gsize digest_len = sizeof(digest);
- gfloat hue = 0, red = 0, green = 0, blue = 0;
+ GdkRGBA background;
+ GChecksum *checksum = NULL;
+ guchar digest[20];
+ gsize digest_len = sizeof(digest);
+ gfloat hue = 0, red = 0, green = 0, blue = 0;
- g_return_if_fail(color != NULL);
+ g_return_if_fail(color != NULL);
-#warning figure out how to get the background color
- gdk_rgba_parse(&background, "#FFFFFFFF");
+#pragma message("figure out how to get the background color")
+ gdk_rgba_parse(&background, "#FFFFFFFF");
- /* hash the string and get the first 2 bytes of the digest */
- checksum = g_checksum_new(G_CHECKSUM_SHA1);
- if(text != NULL) {
- g_checksum_update(checksum, (const guchar *)text, -1);
- }
- g_checksum_get_digest(checksum, digest, &digest_len);
- g_checksum_free(checksum);
+ /* hash the string and get the first 2 bytes of the digest */
+ checksum = g_checksum_new(G_CHECKSUM_SHA1);
+ if(text != NULL) {
+ g_checksum_update(checksum, (const guchar *)text, -1);
+ }
+ g_checksum_get_digest(checksum, digest, &digest_len);
+ g_checksum_free(checksum);
- /* Calculate the hue based on the digest. We need a value between 0 and 1
- * so we divide the value by 65535 which is the maximum value for 2 bytes.
- */
- hue = (digest[0] << 8 | digest[1]) / 65535.0f;
+ /* Calculate the hue based on the digest. We need a value between 0 and 1
+ * so we divide the value by 65535 which is the maximum value for 2 bytes.
+ */
+ hue = (digest[0] << 8 | digest[1]) / 65535.0f;
- /* Get the rgb values for the hue at full saturation and value. */
- gtk_hsv_to_rgb(hue, 1.0f, 1.0f, &red, &green, &blue);
+ /* Get the rgb values for the hue at full saturation and value. */
+ gtk_hsv_to_rgb(hue, 1.0f, 1.0f, &red, &green, &blue);
- /* Finally calculate the color summing 20% of the inverted background color
- * with 80% of the color.
- */
- color->red = (0.2f * (1 - background.red)) + (0.8f * red);
- color->green = (0.2f * (1 - background.green)) + (0.8f * green);
- color->blue = (0.2f * (1 - background.blue)) + (0.8f * blue);
- color->alpha = 1.0f;
+ /* Finally calculate the color summing 20% of the inverted background color
+ * with 80% of the color.
+ */
+ color->red = (0.2f * (1 - background.red)) + (0.8f * red);
+ color->green = (0.2f * (1 - background.green)) + (0.8f * green);
+ color->blue = (0.2f * (1 - background.blue)) + (0.8f * blue);
+ color->alpha = 1.0f;
}