1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-14 03:23:29 +00:00

Some OpenMP related fixes.

Fixes for commit 9c331dce49.
This commit is contained in:
Brenden Matthews 2009-05-24 14:02:33 -06:00
parent 19ca4c071a
commit ee9364522a
3 changed files with 15 additions and 14 deletions

View File

@ -327,7 +327,7 @@ int no_buffers;
void update_stuff(void)
{
unsigned int i;
int i;
info.mask = 0;

View File

@ -3910,13 +3910,13 @@ static void generate_text_internal(char *p, int p_max_size,
#ifdef HAVE_OPENMP
#pragma omp parallel for
#endif /* HAVE_OPENMP */
for(i=0; i<barnum; i++) {
for(i=0; i<(int)barnum; i++) {
*(p+i)='#';
}
#ifdef HAVE_OPENMP
#pragma omp parallel for
#endif /* HAVE_OPENMP */
for(; i < obj->a; i++) {
for(i=i /* cheats */; i < obj->a; i++) {
*(p+i)='_';
}
*(p+i)=0;
@ -5295,10 +5295,10 @@ static void generate_text_internal(char *p, int p_max_size,
}
OBJ(combine) {
char buf[2][max_user_text];
unsigned int i, j;
unsigned int longest=0;
unsigned int nextstart;
unsigned int nr_rows[2];
int i, j;
long longest=0;
int nextstart;
int nr_rows[2];
struct llrows {
char* row;
struct llrows* next;
@ -5320,15 +5320,16 @@ static void generate_text_internal(char *p, int p_max_size,
#endif /* HAVE_OPENMP */
for(j=0; j<i; j++) objsub = objsub->sub;
generate_text_internal(buf[i], max_user_text, *objsub, cur);
#ifdef HAVE_OPENMP
#pragma omp parallel for reduction (+:nr_rows[i])
#endif /* HAVE_OPENMP */
/* doesnut work
* #ifdef HAVE_OPENMP
* #pragma omp parallel for reduction (+:nr_rows[i])
* #endif HAVE_OPENMP */
for(j=0; buf[i][j] != 0; j++) {
if(buf[i][j] == '\t') buf[i][j] = ' ';
if(buf[i][j] == '\n') {
buf[i][j] = 0;
current[i]->row = strdup(buf[i]+nextstart);
if(i==0 && strlen(current[i]->row) > longest) longest = strlen(current[i]->row);
if(i==0 && (long)strlen(current[i]->row) > longest) longest = (long)strlen(current[i]->row);
current[i]->next = malloc(sizeof(struct llrows));
current[i] = current[i]->next;
nextstart = j + 1;
@ -5336,7 +5337,7 @@ static void generate_text_internal(char *p, int p_max_size,
}
}
current[i]->row = strdup(buf[i]+nextstart);
if(i==0 && strlen(current[i]->row) > longest) longest = strlen(current[i]->row);
if(i==0 && (long)strlen(current[i]->row) > longest) longest = (long)strlen(current[i]->row);
current[i]->next = NULL;
current[i] = ll_rows[i];
}

View File

@ -45,7 +45,7 @@ celsius_to_fahrenheit(double n)
int
set_temp_output_unit(const char *name)
{
size_t i;
long i;
int rc = 0;
char *buf;
@ -56,7 +56,7 @@ set_temp_output_unit(const char *name)
#ifdef HAVE_OPENMP
#pragma omp parallel for
#endif /* HAVE_OPENMP */
for (i = 0; i < strlen(name); i++)
for (i = 0; i < (long)strlen(name); i++)
buf[i] = tolower(name[i]);
if (!strcmp(buf, "celsius"))