dix: let change_modmap() return BadValue instead of -1
The function returns X result codes, but -1 isn't a valid value here. Therefore all callers explicitly translate -1 to BadValue, so we can return that directly instead of -1. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									8e0a533eb7
								
							
						
					
					
						commit
						7ea43bd5e9
					
				| 
						 | 
					@ -103,15 +103,10 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
 | 
				
			||||||
        rep.success = ret;
 | 
					        rep.success = ret;
 | 
				
			||||||
        WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply),
 | 
					        WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply),
 | 
				
			||||||
                           &rep);
 | 
					                           &rep);
 | 
				
			||||||
    }
 | 
					        return Success;
 | 
				
			||||||
    else if (ret == -1) {
 | 
					 | 
				
			||||||
        return BadValue;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    else {
 | 
					 | 
				
			||||||
        return ret;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return Success;
 | 
					    return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/***********************************************************************
 | 
					/***********************************************************************
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1771,7 +1771,7 @@ ProcSetModifierMapping(ClientPtr client)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    rc = change_modmap(client, PickKeyboard(client), (KeyCode *) &stuff[1],
 | 
					    rc = change_modmap(client, PickKeyboard(client), (KeyCode *) &stuff[1],
 | 
				
			||||||
                       stuff->numKeyPerModifier);
 | 
					                       stuff->numKeyPerModifier);
 | 
				
			||||||
    if (rc == MappingFailed || rc == -1)
 | 
					    if (rc == MappingFailed)
 | 
				
			||||||
        return BadValue;
 | 
					        return BadValue;
 | 
				
			||||||
    if (rc != MappingSuccess && rc != MappingFailed && rc != MappingBusy)
 | 
					    if (rc != MappingSuccess && rc != MappingFailed && rc != MappingBusy)
 | 
				
			||||||
        return rc;
 | 
					        return rc;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -150,7 +150,7 @@ check_modmap_change(ClientPtr client, DeviceIntPtr dev, KeyCode *modmap)
 | 
				
			||||||
         * keycode range. */
 | 
					         * keycode range. */
 | 
				
			||||||
        if (i < xkb->min_key_code || i > xkb->max_key_code) {
 | 
					        if (i < xkb->min_key_code || i > xkb->max_key_code) {
 | 
				
			||||||
            client->errorValue = i;
 | 
					            client->errorValue = i;
 | 
				
			||||||
            return -1;
 | 
					            return BadValue;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* None of the new modifiers may be down while we change the
 | 
					        /* None of the new modifiers may be down while we change the
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue