Changeset 601733d


Ignore:
Timestamp:
Jul 30, 2008, 6:35:08 PM (16 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
731dd1e
Parents:
bfc127b
Message:
The color default has been -1 for a while now, so we match what curses thinks.
We shouldn't also believe that -1 means invalid color.
Adding OWL_COLOR_INVALID (-2) and using that in place of -1 when checking for invalid colors.
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • filter.c

    raf1920fd r601733d  
    2929  while ( argc>=2 && ( !strcmp(argv[0], "-c") ||
    3030                       !strcmp(argv[0], "-b") ) ) {
    31     if (owl_util_string_to_color(argv[1])==-1) {
     31    if (owl_util_string_to_color(argv[1])==OWL_COLOR_INVALID) {
    3232      owl_function_error("The color '%s' is not available, using default.", argv[1]);
    3333    } else {
  • functions.c

    rdd28b51 r601733d  
    23922392      return;
    23932393    }
    2394     if (owl_util_string_to_color(argv[3])==-1) {
     2394    if (owl_util_string_to_color(argv[3])==OWL_COLOR_INVALID) {
    23952395      owl_function_error("The color '%s' is not available.", argv[3]);
    23962396      return;
     
    24072407      return;
    24082408    }
    2409     if (owl_util_string_to_color(argv[3])==-1) {
     2409    if (owl_util_string_to_color(argv[3])==OWL_COLOR_INVALID) {
    24102410      owl_function_error("The color '%s' is not available.", argv[3]);
    24112411      return;
     
    29412941  }
    29422942
    2943   if (owl_util_string_to_color(fgcolor)==-1) {
     2943  if (owl_util_string_to_color(fgcolor)==OWL_COLOR_INVALID) {
    29442944    owl_function_error("No color named '%s' avilable.", fgcolor);
    29452945    return(-1);
     
    29482948
    29492949  if (bgcolor != NULL) {
    2950     if (owl_util_string_to_color(bgcolor)==-1) {
     2950    if (owl_util_string_to_color(bgcolor)==OWL_COLOR_INVALID) {
    29512951      owl_function_error("No color named '%s' avilable.", bgcolor);
    29522952      return(-1);
  • owl.h

    rd7a3188 r601733d  
    100100#define OWL_COLOR_WHITE     7
    101101#define OWL_COLOR_DEFAULT   -1
     102#define OWL_COLOR_INVALID   -2
    102103
    103104#define OWL_EDITWIN_STYLE_MULTILINE 0
  • util.c

    ree310eb r601733d  
    498498    return(c);
    499499  }
    500   return(-1);
     500  return(OWL_COLOR_INVALID);
    501501}
    502502
Note: See TracChangeset for help on using the changeset viewer.